Record Class EnchantedItemInUse
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.EnchantedItemInUse
public record EnchantedItemInUse(ItemStack itemStack, @Nullable EquipmentSlot inSlot, @Nullable LivingEntity owner, Consumer<Item> onBreak)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable EquipmentSlotThe field for theinSlotrecord component.private final ItemStackThe field for theitemStackrecord component.The field for theonBreakrecord component.private final @Nullable LivingEntityThe field for theownerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEnchantedItemInUse(ItemStack itemStack, @Nullable EquipmentSlot inSlot, @Nullable LivingEntity owner, Consumer<Item> onBreak) Creates an instance of aEnchantedItemInUserecord class.EnchantedItemInUse(ItemStack itemStack, EquipmentSlot inSlot, LivingEntity owner) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable EquipmentSlotinSlot()Returns the value of theinSlotrecord component.Returns the value of theitemStackrecord component.onBreak()Returns the value of theonBreakrecord component.@Nullable LivingEntityowner()Returns the value of theownerrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
itemStack
The field for theitemStackrecord component. -
inSlot
The field for theinSlotrecord component. -
owner
The field for theownerrecord component. -
onBreak
-
-
Constructor Details
-
EnchantedItemInUse
-
EnchantedItemInUse
public EnchantedItemInUse(ItemStack itemStack, @Nullable EquipmentSlot inSlot, @Nullable LivingEntity owner, Consumer<Item> onBreak) Creates an instance of aEnchantedItemInUserecord class.- Parameters:
itemStack- the value for theitemStackrecord componentinSlot- the value for theinSlotrecord componentowner- the value for theownerrecord componentonBreak- the value for theonBreakrecord component
-
-
Method Details
-
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). -
itemStack
Returns the value of theitemStackrecord component.- Returns:
- the value of the
itemStackrecord component
-
inSlot
Returns the value of theinSlotrecord component.- Returns:
- the value of the
inSlotrecord component
-
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
onBreak
-