Item Durability
The arc:item_durability condition type checks the durability of the item involved in the action.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
durability | double | ✅Required | - | The durability value. |
comparison | ComparisonType | ❌Optional | == | Comparison type. |
is_percentage | boolean | ❌Optional | false | Is the value a percentage. |
Example
The following example prevents using an item if it has less than 10 durability.
{
"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
🧪 On Brew Potion
The arc:onbrewpotion action type is triggered when a player brews a potion.
🛠️ On Craft Item
The arc:oncraftitem action type is triggered when a player crafts an item.
🥤 On Drink
The arc:on_drink action type is triggered when a player drinks an item (e.g., potion, milk bucket, etc.).
🪣 On Drop Item
The arc:ondropitem action type is triggered when a player drops an item.
🍽️ On Eat
The arc:on_eat action type is triggered when a player eats an item.
🪣 On Empty Bucket
The arc:onemptybucket action type is triggered when a player places a liquid or fish from a bucket.
✨ On Enchant Item
The arc:onenchantitem action type is triggered when a player enchants an item.
💧 On Fill Bucket
The arc:onfillbucket action type is triggered when a player picks up a liquid or fish with a bucket.
🎣 On Fished Up Item
The arc:onfishedup_item action type is triggered when a player fishes up an item.
⚔️ On Get Attack Speed
The arc:getattackspeed action type is used to retrieve the attack speed of a player.
⚡ On Get Destroy Speed
The arc:ongetdestroy_speed action type is triggered when a player is determining how quickly they can break a block. This action type allows you to modify the destroy speed based on various conditions.
⚙️ On Grind Item
The arc:ongrinditem action type is triggered when a player grinds an item.
🗡️ On Hurt Item
The arc:onhurtitem action type is triggered when a player hurts/damages an item.
🖱️ On Interact Block
The arc:oninteractblock action type is triggered when a player interacts with a block, such as right-clicking it.
🖱️ On Interact Entity
The arc:oninteractentity action type is triggered when a player interacts with an entity, such as right-clicking it.
💔 On Item Break
The arc:onitembreak action type is triggered when a tool or armor piece loses all durability and breaks.
🤲 On Pickup Item
The arc:onpickupitem action type is triggered when a player picks up an item from the ground.
🏹 On Shoot Projectile
The arc:onshootprojectile action type is triggered when a player shoots a projectile, such as an arrow or a snowball.
🔥 On Smelt Item
The arc:onsmeltitem action type is triggered when a player takes an item out of a furnace, smoker, or blast furnace. Just like experience orbs in vanilla Minecraft, this action also counts the items that are taken out with a hopper. As long as the player takes out one of the smelted items, the action will be triggered. The action is called for every item smelted individually, regardless of how many are taken out at once.
🪵 On Strip Log
The arc:onstriplog action type is triggered when a player strips a log or wood block using an axe.
🏹 On Throw Item
The arc:onthrowitem action type is triggered when a player throws an item (e.g. snowball, egg, ender pearl).
🌿 On Till Soil
The arc:ontillsoil action type is triggered when a player uses a hoe on a dirt-like block to create farmland.
🤝 On Trade With Villager
The arc:ontradewith_villager action type is triggered when a player successfully completes a trade with a Villager or Wandering Trader.
⚒️ On Use Anvil
The arc:onuseanvil action type is triggered when a player uses an anvil to repair or rename an item.
🖱️ On Use Item
The arc:onuseitem action type is triggered when a player uses an item (right-clicks with an item).