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 double
fallback
private boolean
tracked
private String
translationKey
-
Constructor Summary
Constructors Modifier Constructor Description protected
EntityAttribute(String translationKey, double fallback)
-
Method Summary
Modifier and Type Method Description double
clamp(double value)
double
getDefaultValue()
String
getTranslationKey()
boolean
isTracked()
Checks if instances of this attribute should synchronize values to clients.EntityAttribute
setTracked(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
-