Record Class AttributeEnchantmentEffect

java.lang.Object
java.lang.Record
net.minecraft.enchantment.effect.AttributeEnchantmentEffect
Record Components:
id -
attribute -
amount -
operation -
All Implemented Interfaces:
EnchantmentLocationBasedEffect

public record AttributeEnchantmentEffect(Identifier id, RegistryEntry<EntityAttribute> attribute, EnchantmentLevelBasedValue amount, EntityAttributeModifier.Operation operation) extends Record implements EnchantmentLocationBasedEffect
Mappings:
Namespace Name
named net/minecraft/enchantment/effect/AttributeEnchantmentEffect
intermediary net/minecraft/class_9720
official deo
named id
intermediary comp_2839
official b
named attribute
intermediary comp_2718
official d
named amount
intermediary comp_2719
official e
named operation
intermediary comp_2720
official f
  • Field Details

    • id

      private final Identifier id
      The field for the id record component.
    • attribute

      private final RegistryEntry<EntityAttribute> attribute
      The field for the attribute record component.
    • amount

      private final EnchantmentLevelBasedValue amount
      The field for the amount record component.
    • operation

      private final EntityAttributeModifier.Operation operation
      The field for the operation record component.
    • CODEC

      public static final com.mojang.serialization.MapCodec<AttributeEnchantmentEffect> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/enchantment/effect/AttributeEnchantmentEffect;CODEC:Lcom/mojang/serialization/MapCodec;
      intermediary field_51706 Lnet/minecraft/class_9720;field_51706:Lcom/mojang/serialization/MapCodec;
      official a Ldeo;a:Lcom/mojang/serialization/MapCodec;
  • Constructor Details

  • Method Details

    • getModifierId

      private Identifier getModifierId(StringIdentifiable suffix)
      Mappings:
      Namespace Name Mixin selector
      named getModifierId Lnet/minecraft/enchantment/effect/AttributeEnchantmentEffect;getModifierId(Lnet/minecraft/util/StringIdentifiable;)Lnet/minecraft/util/Identifier;
      intermediary method_60769 Lnet/minecraft/class_9720;method_60769(Lnet/minecraft/class_3542;)Lnet/minecraft/class_2960;
      official a Ldeo;a(Lbba;)Lalz;
    • createAttributeModifier

      public EntityAttributeModifier createAttributeModifier(int value, StringIdentifiable suffix)
      Mappings:
      Namespace Name Mixin selector
      named createAttributeModifier Lnet/minecraft/enchantment/effect/AttributeEnchantmentEffect;createAttributeModifier(ILnet/minecraft/util/StringIdentifiable;)Lnet/minecraft/entity/attribute/EntityAttributeModifier;
      intermediary method_60228 Lnet/minecraft/class_9720;method_60228(ILnet/minecraft/class_3542;)Lnet/minecraft/class_1322;
      official a Ldeo;a(ILbba;)Lbxl;
    • apply

      public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity user, Vec3d pos, boolean newlyApplied)
      Specified by:
      apply in interface EnchantmentLocationBasedEffect
      Mappings:
      Namespace Name Mixin selector
      named apply Lnet/minecraft/enchantment/effect/EnchantmentLocationBasedEffect;apply(Lnet/minecraft/server/world/ServerWorld;ILnet/minecraft/enchantment/EnchantmentEffectContext;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Vec3d;Z)V
      intermediary method_60221 Lnet/minecraft/class_9722;method_60221(Lnet/minecraft/class_3218;ILnet/minecraft/class_9699;Lnet/minecraft/class_1297;Lnet/minecraft/class_243;Z)V
      official a Ldeq;a(Lash;ILddx;Lbvj;Lfbx;Z)V
    • remove

      public void remove(EnchantmentEffectContext context, Entity user, Vec3d pos, int level)
      Specified by:
      remove in interface EnchantmentLocationBasedEffect
      Mappings:
      Namespace Name Mixin selector
      named remove Lnet/minecraft/enchantment/effect/EnchantmentLocationBasedEffect;remove(Lnet/minecraft/enchantment/EnchantmentEffectContext;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Vec3d;I)V
      intermediary method_60222 Lnet/minecraft/class_9722;method_60222(Lnet/minecraft/class_9699;Lnet/minecraft/class_1297;Lnet/minecraft/class_243;I)V
      official a Ldeq;a(Lddx;Lbvj;Lfbx;I)V
    • getModifiers

      Mappings:
      Namespace Name Mixin selector
      named getModifiers Lnet/minecraft/enchantment/effect/AttributeEnchantmentEffect;getModifiers(ILnet/minecraft/entity/EquipmentSlot;)Lcom/google/common/collect/HashMultimap;
      intermediary method_60230 Lnet/minecraft/class_9720;method_60230(ILnet/minecraft/class_1304;)Lcom/google/common/collect/HashMultimap;
      official a Ldeo;a(ILbvr;)Lcom/google/common/collect/HashMultimap;
    • getCodec

      public com.mojang.serialization.MapCodec<AttributeEnchantmentEffect> getCodec()
      Specified by:
      getCodec in interface EnchantmentLocationBasedEffect
      Mappings:
      Namespace Name Mixin selector
      named getCodec Lnet/minecraft/enchantment/effect/EnchantmentLocationBasedEffect;getCodec()Lcom/mojang/serialization/MapCodec;
      intermediary method_60219 Lnet/minecraft/class_9722;method_60219()Lcom/mojang/serialization/MapCodec;
      official a Ldeq;a()Lcom/mojang/serialization/MapCodec;
    • 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.
    • id

      public Identifier id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • attribute

      public RegistryEntry<EntityAttribute> attribute()
      Returns the value of the attribute record component.
      Returns:
      the value of the attribute record component
    • amount

      public EnchantmentLevelBasedValue amount()
      Returns the value of the amount record component.
      Returns:
      the value of the amount record component
    • operation

      Returns the value of the operation record component.
      Returns:
      the value of the operation record component