Same Equipped Item (Bi-Entity Condition Type)
Checks whether the actor and the target hold the same item in the given equipment slots. By default only the item type has to match. Turn on compare_count and compare_tag to require the stack size and the item data to match as well.
Type ID: apoli:same_equipped_item
Fields
| Field | Type | Default | Description |
|---|---|---|---|
equipment_slot | String or list | "mainhand" | The actor's slots to read: "mainhand", "offhand", "head", "chest", "legs" or "feet". |
target_equipment_slot | String or list | optional | The target's slots to read. Defaults to equipment_slot. |
compare_id | Boolean | true | The two stacks must be the same item. |
compare_count | Boolean | false | The two stacks must have the same count. |
compare_tag | Boolean | false | The two stacks must carry identical item data, such as enchantments, a custom name and custom data. compare_components and compare_nbt are other spellings. |
allow_empty | Boolean | false | Counts two empty slots as a match. It is off by default, so a pair with empty hands never passes. |
item_condition | Item Condition Type | optional | The actor's stack must also pass this. |
With more than one slot listed, the condition passes when any actor slot matches any target slot, so "equipment_slot": ["mainhand", "offhand"] means either of my hands holds what either of theirs does.
Examples
Both wielding the same weapon:
{
"type": "apoli:same_equipped_item",
"equipment_slot": "mainhand"
}A mirror match, with the same sword and the same enchantments:
{
"type": "apoli:same_equipped_item",
"equipment_slot": "mainhand",
"compare_tag": true,
"item_condition": {
"type": "apoli:ingredient",
"ingredient": { "tag": "minecraft:swords" }
}
}Their helmet is what you are holding:
{
"type": "apoli:same_equipped_item",
"equipment_slot": "mainhand",
"target_equipment_slot": "head"
}