Package net.minecraft.enchantment
Record Class EnchantmentEffectContext
java.lang.Object
java.lang.Record
net.minecraft.enchantment.EnchantmentEffectContext
- Record Components:
- stack-
- slot-
- owner-
- breakCallback-
public record EnchantmentEffectContext(ItemStack stack, @Nullable EquipmentSlot slot, @Nullable LivingEntity owner, Consumer<Item> breakCallback)
extends Record
- Mappings:
- Namespace - Name - named - net/minecraft/enchantment/EnchantmentEffectContext- intermediary - net/minecraft/class_9699- official - dcz- named - stack- intermediary - comp_2682- official - a- named - slot- intermediary - comp_2683- official - b- named - owner- intermediary - comp_2684- official - c- named - breakCallback- intermediary - comp_2685- official - d
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe field for thebreakCallbackrecord 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 SummaryConstructorsConstructorDescriptionEnchantmentEffectContext(ItemStack itemStack, @Nullable EquipmentSlot equipmentSlot, @Nullable LivingEntity livingEntity, Consumer<Item> consumer) EnchantmentEffectContext(ItemStack stack, EquipmentSlot slot, LivingEntity owner) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the value of thebreakCallbackrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.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- 
stackThe field for thestackrecord component.
- 
slotThe field for theslotrecord component.
- 
ownerThe field for theownerrecord component.
- 
breakCallbackThe field for thebreakCallbackrecord component.
 
- 
- 
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;)V- intermediary - <init>- Lnet/minecraft/class_9699;<init>(Lnet/minecraft/class_1799;Lnet/minecraft/class_1304;Lnet/minecraft/class_1309;)V- official - <init>- Ldcz;<init>(Lcwq;Lbuu;Lbvi;)V
 
- 
EnchantmentEffectContextpublic EnchantmentEffectContext(ItemStack itemStack, @Nullable @Nullable EquipmentSlot equipmentSlot, @Nullable @Nullable LivingEntity livingEntity, Consumer<Item> consumer) 
 
- 
- 
Method Details- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
stackReturns the value of thestackrecord component.- Returns:
- the value of the stackrecord component
 
- 
slotReturns the value of theslotrecord component.- Returns:
- the value of the slotrecord component
 
- 
ownerReturns the value of theownerrecord component.- Returns:
- the value of the ownerrecord component
 
- 
breakCallbackReturns the value of thebreakCallbackrecord component.- Returns:
- the value of the breakCallbackrecord component
 
 
-