Skip to content

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:

Name Type Description
ABSORPTION
ATTACK_DAMAGE
FOLLOW_RANGE
HEALTH
JUMP_STRENGTH
KNOCKBACK_RESISTANCE
LAVA_MOVEMENT_SPEED
LUCK
MOVEMENT_SPEED
PLAYER_EXHAUSTION
PLAYER_EXPERIENCE
PLAYER_HUNGER
PLAYER_LEVEL
PLAYER_SATURATION
UNDERWATER_MOVEMENT_SPEED
ZOMBIE_SPAWN_REINFORCEMENTS

ABSORPTION class-attribute instance-attribute

ABSORPTION = 'minecraft:absorption'

ATTACK_DAMAGE class-attribute instance-attribute

ATTACK_DAMAGE = 'minecraft:attack_damage'

FOLLOW_RANGE class-attribute instance-attribute

FOLLOW_RANGE = 'minecraft:follow_range'

HEALTH class-attribute instance-attribute

HEALTH = 'minecraft:health'

JUMP_STRENGTH class-attribute instance-attribute

JUMP_STRENGTH = 'minecraft:jump_strength'

KNOCKBACK_RESISTANCE class-attribute instance-attribute

KNOCKBACK_RESISTANCE = 'minecraft:knockback_resistance'

LAVA_MOVEMENT_SPEED class-attribute instance-attribute

LAVA_MOVEMENT_SPEED = 'minecraft:lava_movement'

LUCK class-attribute instance-attribute

LUCK = 'minecraft:luck'

MOVEMENT_SPEED class-attribute instance-attribute

MOVEMENT_SPEED = 'minecraft:movement'

PLAYER_EXHAUSTION class-attribute instance-attribute

PLAYER_EXHAUSTION = 'minecraft:player.exhaustion'

PLAYER_EXPERIENCE class-attribute instance-attribute

PLAYER_EXPERIENCE = 'minecraft:player.experience'

PLAYER_HUNGER class-attribute instance-attribute

PLAYER_HUNGER = 'minecraft:player.hunger'

PLAYER_LEVEL class-attribute instance-attribute

PLAYER_LEVEL = 'minecraft:player.level'

PLAYER_SATURATION class-attribute instance-attribute

PLAYER_SATURATION = 'minecraft:player.saturation'

UNDERWATER_MOVEMENT_SPEED class-attribute instance-attribute

UNDERWATER_MOVEMENT_SPEED = 'minecraft:underwater_movement'

ZOMBIE_SPAWN_REINFORCEMENTS class-attribute instance-attribute

ZOMBIE_SPAWN_REINFORCEMENTS = (
    "minecraft:zombie.spawn_reinforcements"
)

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.

modifiers property

modifiers: list[AttributeModifier]

Get all modifiers present on this instance.

type property

type: str

The attribute type pertaining to this instance.

value property

value: float

Get the value of this instance after all associated modifiers have been applied.

add_modifier

add_modifier(modifier: AttributeModifier) -> None

Add a modifier to this instance.

remove_modifier

remove_modifier(modifier: AttributeModifier) -> None

Remove a modifier from this instance.

AttributeModifier

AttributeModifier(
    name: str,
    amount: float,
    operation: Operation,
    operand: Operand = VALUE,
)

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.

ADD_NUMBER class-attribute instance-attribute

ADD_NUMBER = ADD_NUMBER

ADD_SCALAR class-attribute instance-attribute

ADD_SCALAR = ADD_SCALAR

MAX_VALUE class-attribute instance-attribute

MAX_VALUE = MAX_VALUE

MIN_VALUE class-attribute instance-attribute

MIN_VALUE = MIN_VALUE

MULTIPLY_SCALAR_1 class-attribute instance-attribute

MULTIPLY_SCALAR_1 = MULTIPLY_SCALAR_1

VALUE class-attribute instance-attribute

VALUE = VALUE

amount property

amount: float

Get the amount by which this modifier will apply the operation.

name property

name: str

Get the name of this modifier.

operand property

operand: Operand

Get the operand this modifier will apply.

operation property

operation: Operation

Get the operation this modifier will apply.

unique_id property

unique_id: UUID

Get the unique ID for this modifier.

Operand

Bases: Enum

Value on which operation to be applied.

Attributes:

Name Type Description
MAX_VALUE
MIN_VALUE
VALUE
MAX_VALUE class-attribute instance-attribute
MAX_VALUE = 1
MIN_VALUE class-attribute instance-attribute
MIN_VALUE = 2
VALUE class-attribute instance-attribute
VALUE = 0

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
ADD_NUMBER = 0

Adds (or subtracts) the specified amount to the base value.

ADD_SCALAR class-attribute instance-attribute
ADD_SCALAR = 1

Adds this scalar of amount to the base value.

MULTIPLY_SCALAR_1 class-attribute instance-attribute
MULTIPLY_SCALAR_1 = 2

Multiply amount by this value, after adding 1 to it.