Package cn.nukkit.entity
Class Attribute
java.lang.Object
cn.nukkit.entity.Attribute
- All Implemented Interfaces:
Cloneable
- Since:
- Nukkit 1.0 | Nukkit API 1.0.0
- Author:
- Box, MagicDroidX(code), PeratX @ Nukkit Project
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
伤害吸收static final int
protected float
protected float
static final Attribute[]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected float
protected float
static final int
protected String
static final int
饱食度protected boolean
-
Method Summary
Modifier and TypeMethodDescriptionstatic Attribute
addAttribute
(int id, String name, float minValue, float maxValue, float defaultValue) static Attribute
addAttribute
(int id, String name, float minValue, float maxValue, float defaultValue, boolean shouldSend) clone()
static Attribute
getAttribute
(int id) 获取对应id的Attribute
。static Attribute
getAttributeByName
(String name) 获取对应名字的Attribute
。float
int
getId()
float
float
getName()
float
getValue()
static void
init()
boolean
setDefaultValue
(float defaultValue) setMaxValue
(float maxValue) setMinValue
(float minValue) setValue
(float value) setValue
(float value, boolean fit) toString()
-
Field Details
-
EMPTY_ARRAY
方便执行Collection.toArray()
Convenient execution of
Collection.toArray()
-
ABSORPTION
public static final int ABSORPTION伤害吸收ABSORPTION
- See Also:
-
SATURATION
public static final int SATURATION饱食度SATURATION
- See Also:
-
EXHAUSTION
public static final int EXHAUSTION- See Also:
-
KNOCKBACK_RESISTANCE
public static final int KNOCKBACK_RESISTANCE- See Also:
-
MAX_HEALTH
public static final int MAX_HEALTH- See Also:
-
MOVEMENT_SPEED
public static final int MOVEMENT_SPEED- See Also:
-
FOLLOW_RANGE
public static final int FOLLOW_RANGE- See Also:
-
MAX_HUNGER
public static final int MAX_HUNGER- See Also:
-
FOOD
public static final int FOOD- See Also:
-
ATTACK_DAMAGE
public static final int ATTACK_DAMAGE- See Also:
-
EXPERIENCE_LEVEL
public static final int EXPERIENCE_LEVEL- See Also:
-
EXPERIENCE
public static final int EXPERIENCE- See Also:
-
LUCK
public static final int LUCK- See Also:
-
attributes
-
minValue
protected float minValue -
maxValue
protected float maxValue -
defaultValue
protected float defaultValue -
currentValue
protected float currentValue -
name
-
shouldSend
protected boolean shouldSend
-
-
Method Details
-
init
public static void init() -
addAttribute
-
addAttribute
-
getAttribute
- Parameters:
id
- the id- Returns:
- the attribute
-
getAttributeByName
- Parameters:
name
- name- Returns:
- null |Attribute
-
getMinValue
public float getMinValue() -
setMinValue
-
getMaxValue
public float getMaxValue() -
setMaxValue
-
getDefaultValue
public float getDefaultValue() -
setDefaultValue
-
getValue
public float getValue() -
setValue
-
setValue
-
getName
-
getId
public int getId() -
isSyncable
public boolean isSyncable() -
clone
-
toString
-