Skip to content

Modify Attribute

Modifies the specified attribute with modifiers.

Type ID: kaya:modify/attribute

Format

Field Type Default Description
attribute Identifier The identifier of the attribute to modify.
modifiers Array of Modifiers The modifiers to apply to the specified attribute.

Example

{
    "type": "kaya:modify/attribute",
    "attribute": "minecraft:burning_time",
    "modifiers": [
        {
            "type": "kaya:add",
            "phase": "base",
            "amount": {
                "type": "kaya:product",
                "values": [
                    {
                        "type": "kaya:quotient",
                        "dividend": {
                           "type": "kaya:entity/attribute",
                           "attribute": "minecraft:max_health",
                            "entity": "this"
                        },
                        "divisor": 2
                    },
                    0.1
                ]
            }
        }
    ]
}

This example adds the total value of the entity's minecraft:max_health attribute (divided by 2.0 and multiplied by 0.1) to the entity's minecraft:burning_time attribute, making them burn longer the more health they have.

For instance, let's say the entity has a max health of 20, and a burning time of 1.0. The formula would be $1.0 + ((20 / 2) * 0.1) = 2.0$.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.