Action On Accessory Change (Power Type)
Fires when the holder equips or unequips an accessory. You can react on the wearer, on the item, or both, on either side of the change.
Type ID: apoli:action_on_accessory_change (alias apoli:action_on_trinket_change)
note
This type only exists when an accessory mod is installed: Trinkets, Accessories or Curios, depending on your loader. A pack that uses it must depend on one.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
entity_action_on_equip | Entity Action Type | optional | Runs on the wearer when something is equipped. |
item_action_on_equip | Item Action Type | optional | Runs on the item when it is equipped. |
entity_action_on_unequip | Entity Action Type | optional | Runs on the wearer when something is unequipped. |
item_action_on_unequip | Item Action Type | optional | Runs on the item when it is unequipped. |
item_condition | Item Condition Type | optional | Only fires for items that pass it. |
slots | Array of slots | [] | The accessory slots to watch. A string is slot, group/slot or group/slot/index, such as "ring", "hand/ring" or "hand/ring/0". An empty list means every slot. |
Examples
{
"type": "apoli:action_on_accessory_change",
"slots": ["hand/ring"],
"entity_action_on_equip": {
"type": "apoli:spawn_particles",
"particle": "minecraft:enchant",
"count": 20
},
"entity_action_on_unequip": {
"type": "apoli:play_sound",
"sound": "minecraft:block.beacon.deactivate"
}
}This makes a puff of enchantment particles when a ring goes on, and plays a sound when one comes off.
{
"type": "apoli:action_on_accessory_change",
"item_condition": {
"type": "apoli:ingredient",
"ingredient": { "item": "minecraft:echo_shard" }
},
"entity_action_on_unequip": {
"type": "apoli:damage",
"amount": 4,
"damage_type": "minecraft:magic"
}
}This cursed amulet, an echo shard in an accessory slot, burns the wearer for 4 damage when they take it off.