Skip to content

Entity Has Item Equipped

Checks if an entity has an item equipped to a specific slot.

Type ID: kaya:entity_has_item_equipped

Info

This type will provide the following context parameters to its equipped_condition when checking the items on the specified slot:

Parameters Description
kaya:equipped_item The item stack equipped on the slot.

Format

Field Type Default Description
equipped_condition Condition optional If specified, this condition will be checked on the item from the specified slot.
slot Equipment Slot Group The slot to check the items for.
entity Entity Provider The entity to get the items from.

Example

{
    "type": "kaya:entity_has_item_equipped",
    "equipped_condition": {
        "type": "kaya:item_matches_predicate",
        "predicate": "*[minecraft:food]",
        "item": "equipped_item"
    },
    "slot": "hand",
    "entity": "this"
}

This example will check if items that has the minecraft:food item component is in any of the hands of the entity provided by the kaya:this_entity context parameter.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.