public class EntityAttribute extends Object
An attribute is a tracked double value stored on an entity. An attribute has a default value on which attribute modifiers operate.
Modifier and Type | Field and Description |
---|---|
private double |
fallback |
private boolean |
tracked |
private String |
translationKey |
Modifier | Constructor and Description |
---|---|
protected |
EntityAttribute(String translationKey,
double fallback) |
Modifier and Type | Method and 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.
|
private final double fallback
private boolean tracked
private final String translationKey
protected EntityAttribute(String translationKey, double fallback)
public double getDefaultValue()
public boolean isTracked()
public EntityAttribute setTracked(boolean tracked)
public double clamp(double value)
public String getTranslationKey()