Modify Accessory (Entity Action Type)

Acts on the accessories the entity is wearing.

Runs an action on the accessories the entity currently has equipped, optionally filtering which ones and how many.

Type ID: apoli:modify_accessory (alias apoli:modify_trinket)

Fields

FieldTypeDefaultDescription
slotsarray of String or objects[]Which accessory slots to look at. A string is slot, group/slot, or group/slot/index — for example "ring", "hand/ring", "hand/ring/0". An empty list means every slot.
item_conditionItem ConditionoptionalOnly act on accessories matching this.
item_actionItem ActionoptionalRuns on each matching accessory.
entity_actionEntity ActionoptionalRuns on the wearer, once, if anything matched.
limitInteger0Stop after this many matches. 0 means no limit.
unequipBooleanfalseRemove each matching accessory after acting on it.

Examples

Damage every equipped accessory by one point:

{
  "type": "apoli:modify_accessory",
  "item_action": { "type": "apoli:damage", "amount": 1 }
}

Strip one iron accessory and tell the wearer, which is the shape a “disarm” ability wants:

{
  "type": "apoli:modify_accessory",
  "limit": 1,
  "unequip": true,
  "item_condition": {
    "type": "apoli:ingredient",
    "ingredient": { "tag": "c:ingots/iron" }
  },
  "entity_action": {
    "type": "apoli:text",
    "text": { "translate": "mypack.accessory.stripped" }
  }
}

Needs an accessory mod — Trinkets, Accessories or Curios, depending on your loader. These types do not exist without one, so a pack using them must depend on it.