Durability - TheNuclearNexus/SmithedLibDocs GitHub Wiki

Custom durability works by detecting when the item's vanilla durability decreases and then recalculating the custom durability's value. This alsos mending and unbreaking to work like it would in vanilla. The full list of supported tools can be found here.

Setup

The item

  1. Pick your block entity of choice
  2. Give it the proper nbt, replacing <durability> with your items’s durability
give @s minecraft:wooden_pickaxe{smithed:{durability:{max:<durability>}}}

Troubleshooting

If a you get a warning in chat or your tool is losing all its durability, it is possible that you are using an item that is unsupported. Refer to the list of supported tools. It is also useful to set your smd.logLevel to one or greater to recieve warnings.

Additional Features

Forcing damage on the item

To damage an item by one (respecting unbreaking) execute the following as the player

function smithed:core/item/durability/damage/[slot]
⚠️ **GitHub.com Fallback** ⚠️