Skip to content

Compare

Compares two objects, where the result will depend on the specified comparison.

Type ID: kaya:compare

Format

Field Type Default Description
comparison Comparison The comparison to use for comparing two objects.

Example

{
    "type": "kaya:compare",
    "comparison": {
        "type": "kaya:int",
        "comparator": ">=",
        "first": {
            "type": "kaya:player/food",
            "entity": "this"
        },
        "second": 5
    }
}

This example will check if the food level of the player provided by the kaya:this_entity context parameter is greater than or equal to 5.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.