actions:action_types:damage_item
This is an old revision of the document!
Table of Contents
minecraft:damage_item
The minecraft:damage_item
action damages the item stack in the context by the amount given.
Note that this is different from the minecraft:set_damage item modifier, as this actually breaks the item stack once fully damaged and takes into account preserved items and the Unbreaking enchantment.
It also calls the minecraft:item_durability_changed advancement trigger.
This action is unsuccessful if the item stack is empty, is not damageable or if the action does not ignore the game mode and this
player is in creative mode.
Fields
Name | Description | Type | Default Value |
---|---|---|---|
amount | The amount to damage the item stack by. | A positive integer | |
ignore_game_mode | Whether to always apply damage, regardless if this player is in creative mode or not. | An optional boolean | false |
Example
{ "type": "minecraft:damage_item", "amount": 1 }
actions/action_types/damage_item.1714657606.txt.gz · Last modified: 2024/05/02 13:46 by errorcraft