Attributed Modifier
An object that contains an attribute and its modifier.
Format
| Field | Type | Default | Description |
|---|---|---|---|
attribute |
Identifier | The identifier of the attribute to modify. | |
id |
Identifier | The identifier of the modifier. This can be arbitrary. | |
amount |
Float | The amount of the modifier. | |
operation |
String | Determines how the modifier modifies the value. |
Info
Attributed modifiers are performed in the following order:
| Operation | Description |
|---|---|
add_value |
Adds all of the modifiers' amounts to the base value of the attribute. $(Total = Base + Amount_1 + Amount_2 + ... + Amount_n)$ |
add_multiplied_base |
Multiplies the base value of the attribute by (1 + sum of modifiers' amounts.) $(Total = Base * (1 + Amount_1 + Amount_2 + ... + Amount_n))$ |
add_multiplied_total |
Multiplies the base value of the attribute by (1 + modifiers' amounts) for every modifier. $(Total = Base * (1 + Amount_1) * (1 + Amount_2) * ... * (1 + Amount_n))$ |
Example
{
"attribute": "minecraft:burning_time",
"id": "example:longer_burning_time",
"amount": 1.0,
"operation": "add_multiplied_total"
}
This example doubles the base value of the minecraft:burning_time attribute of the entity, which is used as a multiplier for how long the entity will burn. $(Total = Base * (1 + 1.0))$
[
{
"attribute": "minecraft:armor",
"id": "example:tuff",
"amount": 1.0,
"operation": "add_multiplied_base"
},
{
"attribute": "minecraft:armor",
"id": "example:so_tuff",
"amount": 3.0,
"operation": "add_multiplied_base"
}
]
This example multiplies the base value of the minecraft:armor attribute by the sum of the modifiers' amounts. $(Total = Base + 1.0 + 3.0)$