Class EntityAttribute

java.lang.Object
net.minecraft.entity.attribute.EntityAttribute
Direct Known Subclasses:
ClampedEntityAttribute

public class EntityAttribute extends Object
Represents a type of double-valued attribute that a living entity may have.

An attribute is a tracked double value stored on an entity. An attribute has a default value on which attribute modifiers operate.

Mappings:
Namespace Name
named net/minecraft/entity/attribute/EntityAttribute
intermediary net/minecraft/class_1320
official buf
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<RegistryEntry<EntityAttribute>> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/entity/attribute/EntityAttribute;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_51575 Lnet/minecraft/class_1320;field_51575:Lcom/mojang/serialization/Codec;
      official a Lbuf;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,RegistryEntry<EntityAttribute>> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/entity/attribute/EntityAttribute;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_51940 Lnet/minecraft/class_1320;field_51940:Lnet/minecraft/class_9139;
      official b Lbuf;b:Lys;
    • fallback

      private final double fallback
      Mappings:
      Namespace Name Mixin selector
      named fallback Lnet/minecraft/entity/attribute/EntityAttribute;fallback:D
      intermediary field_23697 Lnet/minecraft/class_1320;field_23697:D
      official c Lbuf;c:D
    • tracked

      private boolean tracked
      Mappings:
      Namespace Name Mixin selector
      named tracked Lnet/minecraft/entity/attribute/EntityAttribute;tracked:Z
      intermediary field_23698 Lnet/minecraft/class_1320;field_23698:Z
      official d Lbuf;d:Z
    • translationKey

      private final String translationKey
      Mappings:
      Namespace Name Mixin selector
      named translationKey Lnet/minecraft/entity/attribute/EntityAttribute;translationKey:Ljava/lang/String;
      intermediary field_23699 Lnet/minecraft/class_1320;field_23699:Ljava/lang/String;
      official e Lbuf;e:Ljava/lang/String;
    • category

      private EntityAttribute.Category category
      Mappings:
      Namespace Name Mixin selector
      named category Lnet/minecraft/entity/attribute/EntityAttribute;category:Lnet/minecraft/entity/attribute/EntityAttribute$Category;
      intermediary field_51884 Lnet/minecraft/class_1320;field_51884:Lnet/minecraft/class_1320$class_9764;
      official f Lbuf;f:Lbuf$a;
  • Constructor Details

    • EntityAttribute

      protected EntityAttribute(String translationKey, double fallback)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/attribute/EntityAttribute;<init>(Ljava/lang/String;D)V
      intermediary <init> Lnet/minecraft/class_1320;<init>(Ljava/lang/String;D)V
      official <init> Lbuf;<init>(Ljava/lang/String;D)V
  • Method Details

    • getDefaultValue

      public double getDefaultValue()
      Mappings:
      Namespace Name Mixin selector
      named getDefaultValue Lnet/minecraft/entity/attribute/EntityAttribute;getDefaultValue()D
      intermediary method_6169 Lnet/minecraft/class_1320;method_6169()D
      official a Lbuf;a()D
    • isTracked

      public boolean isTracked()
      Checks if instances of this attribute should synchronize values to clients.
      Mappings:
      Namespace Name Mixin selector
      named isTracked Lnet/minecraft/entity/attribute/EntityAttribute;isTracked()Z
      intermediary method_6168 Lnet/minecraft/class_1320;method_6168()Z
      official b Lbuf;b()Z
    • setTracked

      public EntityAttribute setTracked(boolean tracked)
      Sets all instances of this attribute to synchronize their values to clients.
      Mappings:
      Namespace Name Mixin selector
      named setTracked Lnet/minecraft/entity/attribute/EntityAttribute;setTracked(Z)Lnet/minecraft/entity/attribute/EntityAttribute;
      intermediary method_26829 Lnet/minecraft/class_1320;method_26829(Z)Lnet/minecraft/class_1320;
      official a Lbuf;a(Z)Lbuf;
    • setCategory

      public EntityAttribute setCategory(EntityAttribute.Category category)
      Mappings:
      Namespace Name Mixin selector
      named setCategory Lnet/minecraft/entity/attribute/EntityAttribute;setCategory(Lnet/minecraft/entity/attribute/EntityAttribute$Category;)Lnet/minecraft/entity/attribute/EntityAttribute;
      intermediary method_60493 Lnet/minecraft/class_1320;method_60493(Lnet/minecraft/class_1320$class_9764;)Lnet/minecraft/class_1320;
      official a Lbuf;a(Lbuf$a;)Lbuf;
    • clamp

      public double clamp(double value)
      Mappings:
      Namespace Name Mixin selector
      named clamp Lnet/minecraft/entity/attribute/EntityAttribute;clamp(D)D
      intermediary method_6165 Lnet/minecraft/class_1320;method_6165(D)D
      official a Lbuf;a(D)D
    • getTranslationKey

      public String getTranslationKey()
      Mappings:
      Namespace Name Mixin selector
      named getTranslationKey Lnet/minecraft/entity/attribute/EntityAttribute;getTranslationKey()Ljava/lang/String;
      intermediary method_26830 Lnet/minecraft/class_1320;method_26830()Ljava/lang/String;
      official c Lbuf;c()Ljava/lang/String;
    • getFormatting

      public Formatting getFormatting(boolean addition)
      Mappings:
      Namespace Name Mixin selector
      named getFormatting Lnet/minecraft/entity/attribute/EntityAttribute;getFormatting(Z)Lnet/minecraft/util/Formatting;
      intermediary method_60494 Lnet/minecraft/class_1320;method_60494(Z)Lnet/minecraft/class_124;
      official b Lbuf;b(Z)Ln;