Skip to content

Conditional

Provides the respective value if the specified condition is fulfilled or not.

Type ID: kaya:conditional

Note

This meta type can only provide the same kind of value of the field where it was used. (e.g: if the field is a boolean provider, the value providers to specify must be a boolean provider, etc.)

Format

Field Type Default Description
condition Condition The condition to check.
on_true Value Provider The value to provide if the condition returns true.
on_false Value Provider The value to provide if the condition returns false.

Example

{
    "type": "kaya:conditional",
    "condition": {
        "type": "kaya:check_entity_type",
        "key": "minecraft:creeper",
        "entity": "target"
    },
    "on_true": 100,
    "on_false": 0
}

This example is an int provider that provides $100$ if the entity provided by the kaya:target_entity context parameter is a Creeper, or $0$ if they're not.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.