Skip to main content

Get 25% OFF on your first order with BisectHosting using code "DAQEM"!

Item Durability

The arc:item_durability condition type checks the durability of the item involved in the action.

Parameters

ParameterTypeRequiredDefaultDescription
durabilitydoubleRequired-The durability value.
comparisonComparisonTypeOptional==Comparison type.
is_percentagebooleanOptionalfalseIs the value a percentage.

Example

The following example prevents using an item if it has less than 10 durability.

data/my_datapack/arc/prevent_break.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_use_item",
"conditions": [
{
"type": "arc:item_durability",
"durability": 10,
"comparison": "<"
}
],
"rewards": [
{
"type": "arc:cancel_action"
},
{
"type": "arc:command",
"command": "tellraw %player% {\"text\":\"Item is too damaged!\",\"color\":\"red\"}"
}
]
}

Compatible Action Types