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 |
|
|
MAX_VALUE |
|
|
MIN_VALUE |
|
|
MULTIPLY |
|
|
MULTIPLY_BASE |
|
|
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 |
Adds (or subtracts) the specified amount to the base value. |
|
MULTIPLY |
For every modifier, multiplies the current value of the attribute by (1 + x), where x is the amount of the particular modifier. |
|
MULTIPLY_BASE |
Multiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts. |
ADD
class-attribute
instance-attribute
¶
Adds (or subtracts) the specified amount to the base value.
MULTIPLY
class-attribute
instance-attribute
¶
For every modifier, multiplies the current value of the attribute by (1 + x), where x is the amount of the particular modifier.
MULTIPLY_BASE
class-attribute
instance-attribute
¶
Multiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts.