Skip to content

Set Resource (Float)

Sets the value of a power that uses the Resource Float power type.

Type ID: kaya:set_resource/float

Format

Field Type Default Description
power Power Identifier The resource power to set the value of.
entity Entity Provider The entity to get the power from.
value Float Provider The float value to use.

Example

{
    "type": "kaya:set_resource/float",
    "power": "example:resource_awesome_sauce_but_as_float",
    "entity": "this",
    "value": {
        "type": "kaya:product",
        "values": [
            {
                "type": "kaya:entity/attribute",
                "attribute": "minecraft:armor",
                "entity": "this"
            },
            0.01
        ]
    }
}

This example will set the value of the example:resource_awesome_sauce_but_float power from the entity provided by the kaya:this_entity context parameter to the value of its minecraft:armor attribute multiplied by 0.01.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.