endstone.attribute

Classes relevant to attributes.

Classes relevant to attributes.

Classes

NameDescription
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.

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

NameDescription
add_modifier

Add a modifier to this instance.

remove_modifier

Remove a modifier from this instance.

Attributes

NameTypeDescription
base_valuefloat

Base value of this instance before modifiers are applied.

modifierslist[AttributeModifier]

Get all modifiers present on this instance.

typestr

The attribute type pertaining to this instance.

valuefloat

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

attrbase_valueproperty

base_value: float

Base value of this instance before modifiers are applied.

attrmodifiersproperty

Get all modifiers present on this instance.

attrtypeproperty

type: str

The attribute type pertaining to this instance.

attrvalueproperty

value: float

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

methadd_modifier

add_modifier(modifier: AttributeModifier) -> None

Add a modifier to this instance.

methremove_modifier

remove_modifier(modifier: AttributeModifier) -> None

Remove a modifier from this instance.

classAttributeModifier

AttributeModifier(name: str, amount: float, operation: Operation)

Represents an attribute modifier.

Classes

NameDescription
Operation

Operation to be applied.

Attributes

NameTypeDescription
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.

amountfloat

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

namestr

Get the name of this modifier.

operationOperation

Get the operation this modifier will apply.

unique_idUUID

Get the unique ID for this modifier.

attrADD

ADD

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

attrMULTIPLY

MULTIPLY

For 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

Multiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts.

attramountproperty

amount: float

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

attrnameproperty

name: str

Get the name of this modifier.

attroperationproperty

operation: Operation

Get the operation this modifier will apply.

attrunique_idproperty

unique_id: UUID

Get the unique ID for this modifier.

classOperation

Bases: Enum

Operation()

Operation to be applied.

Attributes

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

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

attrMULTIPLY

MULTIPLY = 2

For 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 = 1

Multiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts.

On this page