minecraft:durability for you with a switch.Get GodCraftOverview
minecraft:durability is an item component: it goes in the components object of a custom item. Gives the item a health bar that goes down as it is used, until it breaks. It also allows repairing and combining two worn items in an anvil or grindstone.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
max_durability | integer | none | How many uses the item survives before it breaks.Range: 0 to … |
damage_chance | IntRange | {"max":100,"min":100} | Percent chance (as a min and max range) that a use actually wears the item down. Lower it to make the item last longer. |
Example
Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):
BP/items/<name>.json
{
"minecraft:durability": {
"max_durability": 0,
"damage_chance": {
"max": 100,
"min": 100
}
}
}