Record Class ItemInput
java.lang.Object
java.lang.Record
net.minecraft.commands.arguments.item.ItemInput
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataComponentPatchThe field for thecomponentsrecord component.private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeThe field for theitemrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionItemInput(Holder<Item> item, DataComponentPatch components) Creates an instance of aItemInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentsrecord component.createItemStack(int count) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
item
-
components
The field for thecomponentsrecord component. -
ERROR_STACK_TOO_BIG
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_STACK_TOO_BIG -
ERROR_MALFORMED_ITEM
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_MALFORMED_ITEM
-
-
Constructor Details
-
ItemInput
Creates an instance of aItemInputrecord class.- Parameters:
item- the value for theitemrecord componentcomponents- the value for thecomponentsrecord component
-
-
Method Details
-
createItemStack
public ItemStack createItemStack(int count) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
item
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-