Skip to main content
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Item Documentation - minecraft:durability
- Article
- 10/17/2022
- 2 minutes to read
In this article
minecraft:durability sets how much damage the item can take before breaking.
Important
minecraft:durability requires the Holiday Creator Features experimental toggle to be set to true in order to function properly.
Holiday Creator Features contains experimental gameplay features. As with all experiments, you may see additions, removals, and changes in functionality in Minecraft versions without significant advanced warning.
To learn more about Experimental Features, please visit Experimental Features in Minecraft: Bedrock Edition
Parameters
damage_chance | not set | Float | Damage chance is the percentage chance of this item losing durability. Default is set to 100. |
max_durability | not set | Integer | Max durability is the amount of damage that this item can take before breaking. |
Example
"minecraft:durability":{ "damage_chance": 0.015, //15% "max_durability": 36 }Feedback
Submit and view feedback for
Introduction
1.16.100 items have different durability mechanic than 1.10 and 1.16 items. Now you need to define when will the item get durability damage and also an event that does it. What will be discussed on this page:
- Event that updates durability
- on_hurt_entity durability update
- on_dig durability update
- repair_amount value
- on_tool_used event
Event
BP/items/my_item.json#eventsCopy
"durability_update": { "damage": { "type": "durability", "amount": 1, "target": "self" } }
1
2
3
4
5
6
7
When this event is called the item (self target) will receive durability damage. Looks simple, doesn't it?
on_hurt_entity
on_hurt_entity can be defined in "minecraft:weapon" component. It tells the game what event should happen when player hurts entity using this item.
BP/items/my_item.json#componentsCopy
"minecraft:weapon": { "on_hurt_entity": { "event": "durability_update" } }
1
2
3
4
5
on_dig
on_dig can be defined in "minecraft:digger" component. It tells the game what event should happen when player dug a block using this item.
BP/items/my_item.json#componentsCopy
"minecraft:digger": { "use_efficiency": true, "destroy_speeds": [ { "block": { "tags": "q.any_tag('wood')" }, "speed": 8, "on_dig": { // Defines event that should happen when block with tag wood was dug. "event": "durability_update" } } ], "on_dig": { // Defines event that should happen when any block was destroyed. "event": "damage_item" } }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
repair_amount
repair_amount can be defined in "minecraft:repairable" component. It tells the game how much of the item's durability should be back when it was repaired.
BP/items/my_item.json#componentsCopy
"minecraft:repairable": { "repair_items": [ { "repair_amount": "context.other->query.remaining_durability + 0.05 * context.other->query.max_durability", "items": [ "bs:silver", "bs:silver_axe" ] } ] }
1
2
3
4
5
6
7
8
9
10
11
Formula explanation:
"context.other->query.remaining_durability + 0.05 * context.other->query.max_durability"
The final durability will be durability of the first axe + durability of the second axe + 5% of 2nd axe MAX durability.
(This might not work now) on_tool_used is special event that can be called using tags. Tags work kinda like runtime identifiers for entities. Known tags:
minecraft:is_axe | Strips logs | By interacting with blocks that axe interacts with |
minecraft:is_hoe | Makes farmland | By interacting with blocks that hoe interacts with |
minecraft:is_pickaxe | Unknown | Unknown |
minecraft:is_sword | Unknown | Unknown |
You can apply these tags this way:
BP/items/my_item.json#componentsCopy
"tag:minecraft:is_axe": {}
1