Package net.minecraft.entity.attribute
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 Summary
Fields Modifier and Type Field Description private doublefallbackprivate booleantrackedprivate StringtranslationKey -
Constructor Summary
Constructors Modifier Constructor Description protectedEntityAttribute(String translationKey, double fallback) -
Method Summary
Modifier and Type Method Description doubleclamp(double value)doublegetDefaultValue()StringgetTranslationKey()booleanisTracked()Checks if instances of this attribute should synchronize values to clients.EntityAttributesetTracked(boolean tracked)Sets all instances of this attribute to synchronize their values to clients.
-
Field Details
-
fallback
private final double fallback -
tracked
private boolean tracked -
translationKey
-
-
Constructor Details
-
EntityAttribute
-
-
Method Details
-
getDefaultValue
public double getDefaultValue() -
isTracked
public boolean isTracked()Checks if instances of this attribute should synchronize values to clients. -
setTracked
Sets all instances of this attribute to synchronize their values to clients. -
clamp
public double clamp(double value) -
getTranslationKey
-