Package net.minecraft.enchantment
Record Class EnchantmentEffectContext
java.lang.Object
java.lang.Record
net.minecraft.enchantment.EnchantmentEffectContext
- Record Components:
stack-slot-owner-onBreak-
public record EnchantmentEffectContext(ItemStack stack, @Nullable EquipmentSlot slot, @Nullable LivingEntity owner, Consumer<Item> onBreak)
extends Record
- Mappings:
Namespace Name named net/minecraft/enchantment/EnchantmentEffectContextintermediary net/minecraft/class_9699official dabnamed stackintermediary comp_2682official anamed slotintermediary comp_2683official bnamed ownerintermediary comp_2684official cnamed onBreakintermediary comp_2685official d
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theonBreakrecord component.private final @Nullable LivingEntityThe field for theownerrecord component.private final @Nullable EquipmentSlotThe field for theslotrecord component.private final ItemStackThe field for thestackrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentEffectContext(ItemStack itemStack, @Nullable EquipmentSlot equipmentSlot, @Nullable LivingEntity livingEntity, Consumer<Item> consumer) EnchantmentEffectContext(ItemStack stack, EquipmentSlot slot, 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.onBreak()Returns the value of theonBreakrecord component.owner()Returns the value of theownerrecord component.slot()Returns the value of theslotrecord component.stack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
Constructor Details
-
EnchantmentEffectContext
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/enchantment/EnchantmentEffectContext;<init>(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EquipmentSlot;Lnet/minecraft/entity/LivingEntity;)Vintermediary <init>Lnet/minecraft/class_9699;<init>(Lnet/minecraft/class_1799;Lnet/minecraft/class_1304;Lnet/minecraft/class_1309;)Vofficial <init>Ldab;<init>(Lcuq;Lbsy;Lbtn;)V
-
EnchantmentEffectContext
public EnchantmentEffectContext(ItemStack itemStack, @Nullable @Nullable EquipmentSlot equipmentSlot, @Nullable @Nullable LivingEntity livingEntity, Consumer<Item> consumer)
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
stack
Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-
slot
Returns the value of theslotrecord component.- Returns:
- the value of the
slotrecord component
-
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
onBreak
Returns the value of theonBreakrecord component.- Returns:
- the value of the
onBreakrecord component
-