Skip to main content

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

FieldTypeDefaultDescription
equipment_slotString or list"mainhand"The actor's slots to read: "mainhand", "offhand", "head", "chest", "legs" or "feet".
target_equipment_slotString or listoptionalThe target's slots to read. Defaults to equipment_slot.
compare_idBooleantrueThe two stacks must be the same item.
compare_countBooleanfalseThe two stacks must have the same count.
compare_tagBooleanfalseThe 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_emptyBooleanfalseCounts two empty slots as a match. It is off by default, so a pair with empty hands never passes.
item_conditionItem Condition TypeoptionalThe 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"
}