User Tools

Site Tools


items:item_components:damageable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
items:item_components:damageable [2024/04/19 13:27] – removed - external edit (Unknown date) 127.0.0.1items:item_components:damageable [2024/04/23 21:24] (current) – add break_sound field errorcraft
Line 1: Line 1:
 +====== minecraft:damageable ======
 +The ''minecraft:damageable'' item component allows this item to be damaged.
 +Its durability may be overridden for a specific item stack by using the [[mc>Item_format/1.20.5#max_damage|minecraft:max_damage]] item stack component.
 +This item component is usually combined with [[items:item_components:tool|minecraft:tool]], [[items:item_components:weapon|minecraft:weapon]] and [[items:item_components:armor|minecraft:armor]].
 +Note that using this item component requires you to set the [[items:item_components:max_stack_size|minecraft:max_stack_size]] item component to 1.
  
 +
 +===== Fields =====
 +^  Name  ^  Description  ^  Type  ^  Default Value  ^
 +| ''durability'' | How many hits this item can take before breaking. | A positive integer | |
 +| ''break_sound'' | The sound event to play when the item breaks. If not present, it uses ''minecraft:entity.item.break'' instead. | An optional [[mc>Sounds.json#Sound_events|sound event]] | |
 +| ''preserve_item'' | Whether to preserve the item at 1 durability. | An optional boolean | ''false'' |
 +
 +
 +===== Example =====
 +<code javascript>
 +{
 +  "durability": 250
 +}
 +</code>