Attribute
endstone.attribute
¶
Classes relevant to attributes.
Classes:
| Name | Description |
|---|---|
Attribute |
All attribute types. |
AttributeInstance |
Represents a mutable instance of an attribute and its associated modifiers and values. |
AttributeModifier |
Represents an attribute modifier. |
Attribute
¶
All attribute types.
Attributes:
KNOCKBACK_RESISTANCE
class-attribute
instance-attribute
¶
LAVA_MOVEMENT_SPEED
class-attribute
instance-attribute
¶
PLAYER_EXHAUSTION
class-attribute
instance-attribute
¶
PLAYER_EXPERIENCE
class-attribute
instance-attribute
¶
PLAYER_SATURATION
class-attribute
instance-attribute
¶
UNDERWATER_MOVEMENT_SPEED
class-attribute
instance-attribute
¶
ZOMBIE_SPAWN_REINFORCEMENTS
class-attribute
instance-attribute
¶
AttributeInstance
¶
Represents a mutable instance of an attribute and its associated modifiers and values.
Methods:
| Name | Description |
|---|---|
add_modifier |
Add a modifier to this instance. |
remove_modifier |
Remove a modifier from this instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
base_max_value |
float
|
Base max value of this instance before modifiers are applied. |
base_min_value |
float
|
Base min value of this instance before modifiers are applied. |
base_value |
float
|
Base value of this instance before modifiers are applied. |
max_value |
float
|
Get the max value of this instance after all associated modifiers have been applied. |
min_value |
float
|
Get the min value of this instance after all associated modifiers have been applied. |
modifiers |
list[AttributeModifier]
|
Get all modifiers present on this instance. |
type |
str
|
The attribute type pertaining to this instance. |
value |
float
|
Get the value of this instance after all associated modifiers have been applied. |
base_max_value
property
writable
¶
base_max_value: float
Base max value of this instance before modifiers are applied.
base_min_value
property
writable
¶
base_min_value: float
Base min value of this instance before modifiers are applied.
base_value
property
writable
¶
base_value: float
Base value of this instance before modifiers are applied.
max_value
property
¶
max_value: float
Get the max value of this instance after all associated modifiers have been applied.
min_value
property
¶
min_value: float
Get the min value of this instance after all associated modifiers have been applied.
value
property
¶
value: float
Get the value of this instance after all associated modifiers have been applied.
remove_modifier
¶
remove_modifier(modifier: AttributeModifier) -> None
Remove a modifier from this instance.
AttributeModifier
¶
Represents an attribute modifier.
Classes:
| Name | Description |
|---|---|
Operand |
Value on which operation to be applied. |
Operation |
Operation to be applied. |
Attributes:
| Name | Type | Description |
|---|---|---|
ADD_NUMBER |
|
|
ADD_SCALAR |
|
|
MAX_VALUE |
|
|
MIN_VALUE |
|
|
MULTIPLY_SCALAR_1 |
|
|
VALUE |
|
|
amount |
float
|
Get the amount by which this modifier will apply the operation. |
name |
str
|
Get the name of this modifier. |
operand |
Operand
|
Get the operand this modifier will apply. |
operation |
Operation
|
Get the operation this modifier will apply. |
unique_id |
UUID
|
Get the unique ID for this modifier. |
Operand
¶
Operation
¶
Bases: Enum
Operation to be applied.
Attributes:
| Name | Type | Description |
|---|---|---|
ADD_NUMBER |
Adds (or subtracts) the specified amount to the base value. |
|
ADD_SCALAR |
Adds this scalar of amount to the base value. |
|
MULTIPLY_SCALAR_1 |
Multiply amount by this value, after adding 1 to it. |
ADD_NUMBER
class-attribute
instance-attribute
¶
Adds (or subtracts) the specified amount to the base value.
ADD_SCALAR
class-attribute
instance-attribute
¶
Adds this scalar of amount to the base value.
MULTIPLY_SCALAR_1
class-attribute
instance-attribute
¶
Multiply amount by this value, after adding 1 to it.