endstone.attribute
Classes relevant to attributes.
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. |
classAttribute
Attribute()All attribute types.
Attributes
attrABSORPTION
ABSORPTION = 'minecraft:absorption'attrATTACK_DAMAGE
ATTACK_DAMAGE = 'minecraft:attack_damage'attrFOLLOW_RANGE
FOLLOW_RANGE = 'minecraft:follow_range'attrHEALTH
HEALTH = 'minecraft:health'attrJUMP_STRENGTH
JUMP_STRENGTH = 'minecraft:jump_strength'attrKNOCKBACK_RESISTANCE
KNOCKBACK_RESISTANCE = 'minecraft:knockback_resistance'attrLAVA_MOVEMENT_SPEED
LAVA_MOVEMENT_SPEED = 'minecraft:lava_movement'attrLUCK
LUCK = 'minecraft:luck'attrMOVEMENT_SPEED
MOVEMENT_SPEED = 'minecraft:movement'attrPLAYER_EXHAUSTION
PLAYER_EXHAUSTION = 'minecraft:player.exhaustion'attrPLAYER_EXPERIENCE
PLAYER_EXPERIENCE = 'minecraft:player.experience'attrPLAYER_HUNGER
PLAYER_HUNGER = 'minecraft:player.hunger'attrPLAYER_LEVEL
PLAYER_LEVEL = 'minecraft:player.level'attrPLAYER_SATURATION
PLAYER_SATURATION = 'minecraft:player.saturation'attrUNDERWATER_MOVEMENT_SPEED
UNDERWATER_MOVEMENT_SPEED = 'minecraft:underwater_movement'attrZOMBIE_SPAWN_REINFORCEMENTS
ZOMBIE_SPAWN_REINFORCEMENTS = 'minecraft:zombie.spawn_reinforcements'classAttributeInstance
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_value | float | Base value of this instance before modifiers are 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. |
attrbase_valueproperty
base_value: floatBase value of this instance before modifiers are applied.
attrmodifiersproperty
modifiers: list[AttributeModifier]Get all modifiers present on this instance.
attrtypeproperty
type: strThe attribute type pertaining to this instance.
attrvalueproperty
value: floatGet the value of this instance after all associated modifiers have been applied.
methadd_modifier
add_modifier(modifier: AttributeModifier) -> NoneAdd a modifier to this instance.
methremove_modifier
remove_modifier(modifier: AttributeModifier) -> NoneRemove a modifier from this instance.
classAttributeModifier
Represents an attribute modifier.
Classes
| Name | Description |
|---|---|
Operation | 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. | |
amount | float | Get the amount by which this modifier will apply the operation. |
name | str | Get the name of this modifier. |
operation | Operation | Get the operation this modifier will apply. |
unique_id | UUID | Get the unique ID for this modifier. |
attrADD
ADDAdds (or subtracts) the specified amount to the base value.
attrMULTIPLY
MULTIPLYFor every modifier, multiplies the current value of the attribute by (1 + x), where x is the amount of the particular modifier.
attrMULTIPLY_BASE
MULTIPLY_BASEMultiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts.
attramountproperty
amount: floatGet the amount by which this modifier will apply the operation.
attrnameproperty
name: strGet the name of this modifier.
attroperationproperty
operation: OperationGet the operation this modifier will apply.
attrunique_idproperty
unique_id: UUIDGet the unique ID for this modifier.
classOperation
Bases: Enum
Operation()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. |
attrADD
ADD = 0Adds (or subtracts) the specified amount to the base value.
attrMULTIPLY
MULTIPLY = 2For every modifier, multiplies the current value of the attribute by (1 + x), where x is the amount of the particular modifier.
attrMULTIPLY_BASE
MULTIPLY_BASE = 1Multiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts.