Skip to content

Damage Item

Deals damage to an item.

Type ID: kaya:damage_item

Format

Field Type Default Description
amount Int Provider 1 The amount of damage to deal.
slot Slot Provider The slot of the item to damage.
ignore_enchantments Boolean Provider false Determines whether enchantments (that can process changes in an item's durability) are ignored.
item_holder Entity Provider optional If specified, this player will be used as the holder of the item.
Info

The item_holder is mostly used for the following scenarios when damaging an item:

  • If the player is present and has infinite materials (e.g: in creative mode), the item will not be damaged.
  • if the player is present, the minecraft:item_durability_changed advancement criterion trigger is invoked.

Example

{
    "type": "kaya:damage_item",
    "amount": 4,
    "slot": "used_item_slot",
    "item_holder": "this"
}

This example will deal 4 damage to the item provided by the kaya:used_item_slot context parameter.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.