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.

  • Field Details

    • fallback

      private final double fallback
    • tracked

      private boolean tracked
    • translationKey

      private final String translationKey
  • Constructor Details

    • EntityAttribute

      protected EntityAttribute​(String translationKey, double fallback)
  • Method Details

    • getDefaultValue

      public double getDefaultValue()
    • isTracked

      public boolean isTracked()
      Checks if instances of this attribute should synchronize values to clients.
    • setTracked

      public EntityAttribute setTracked​(boolean tracked)
      Sets all instances of this attribute to synchronize their values to clients.
    • clamp

      public double clamp​(double value)
    • getTranslationKey

      public String getTranslationKey()