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/EnchantmentEffectContext
intermediary net/minecraft/class_9699
official dab
named stack
intermediary comp_2682
official a
named slot
intermediary comp_2683
official b
named owner
intermediary comp_2684
official c
named onBreak
intermediary comp_2685
official d
  • Field Details

  • Constructor Details

    • EnchantmentEffectContext

      public EnchantmentEffectContext(ItemStack stack, EquipmentSlot slot, LivingEntity owner)
      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> 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • stack

      public ItemStack stack()
      Returns the value of the stack record component.
      Returns:
      the value of the stack record component
    • slot

      Returns the value of the slot record component.
      Returns:
      the value of the slot record component
    • owner

      Returns the value of the owner record component.
      Returns:
      the value of the owner record component
    • onBreak

      public Consumer<Item> onBreak()
      Returns the value of the onBreak record component.
      Returns:
      the value of the onBreak record component