Update Custom Durability authored by Jules's avatar Jules
Custom durability is a really powerful system that allows you to create items with a set amount of uses, unlike the vanilla durability system which forces you to always have the same amount of uses for a type of item -unless you use the Unbreaking enchant which may just look unclean-.\ Custom durability is a really powerful system that allows you to create items with a set amount of uses, unlike the \<1.20.5 vanilla durability system which forces you to always have the same max amount of uses for a type of item.\
All items can have a _Max Durability_ stat, which defines how many times the item can be used before either **breaking** or **becoming unusable**. The _Lost when Broken_ item option defines whether or not the item will be lost when it reaches 0 durability. All items feature the _Max Custom Durability_ stat, which defines how many times an item can be used before either **breaking** or **becoming unusable**. The _Lost when Broken_ item option defines whether or not the item should be lost when reaching 0 durability.
Durability is displayed on the item vanilla durability bar, however you may also display the player's held item durability using PAPI placeholders. Items can be repaired only using repairing consumables. Durability is displayed on the item vanilla durability bar, however you may also display the player's held item durability using PAPI placeholders. Items can be repaired only using repairing consumables.
Since the custom durability system mimics the vanilla durability, there is no longer a way to have a custom textured item with durability in **1.13 or earlier**. 1.14 introduces a CustomModelData tab which can be used to apply a custom texture whatever durability the item has, however since the newest MMOItems durability system overrides the vanilla one, it is no longer possible to have these two options in 1.13, which is the main reason why we would advise 1.13 users to update to 1.14 or 1.15. ## 1.20.5+ Durability
## Durability Placeholders Minecraft 1.20.5 introduced a new item tag which allows you to modify an item's maximum vanilla durability. This tag is fully supported by recent MMOItems builds. We encourage users to switch to this system as the primary reason why MMOItems introduced custom durability was the impossibility to change an item's maximum durability. Now that this has been changed, you no longer need MMOItems custom durability.
This cannot be used in the item lore! These are placeholders that can be used in scoreboards, GUIs or anything else that supports PlaceholderAPI.
* **%mmoitems_durability%** returns the amount of uses left of the item the player is holding. This does not fix the issue of having items which cannot have a durability bar at all, like apples, blocks and most items. An easy workaround is to use a breakable tool like a pickaxe or a shovel and change its texture using a resource pack if you really need a durability bar.
* **%mmoitems_durability_max%** returns the item max durability.\
![](https://i.imgur.com/TaumARR.png) **We encourage users moving to vanilla durability as it is generally better for compatibility with external plugin features, and because MMOItems fully supports it.**
* **%mmoitems_durability_ratio%** returns the item's durability ratio (from 0% to 100%).\
![](https://i.imgur.com/90KnpS2.png) ## Durability Placeholders
* **%mmoitems_durability_bar_square%** returns the item durability as a progress bar.\
![](https://i.imgur.com/HmS1wFR.png) This cannot be used in the item lore! These are placeholders that can be used in scoreboards, GUIs or anything else that supports PlaceholderAPI.
* **%mmoitems_durability_bar_diamond%** returns the durability bar, but the char used is a diamond.\
![](https://i.imgur.com/QPrLKtj.png) * **%mmoitems_durability%** returns the amount of uses left of the item the player is holding.
* **%mmoitems_durability_bar_thin%** returns a much thiner durability bar.\ * **%mmoitems_durability_max%** returns the item max durability.\
![](https://i.imgur.com/MJvhd6S.png) ![](https://i.imgur.com/TaumARR.png)
* **%mmoitems_durability_ratio%** returns the item's durability ratio (from 0% to 100%).\
## Durability in item lore ![](https://i.imgur.com/90KnpS2.png)
As of 6.5+ you can display the item current and max durability in the item lore. Firstly, you would have to add the following line to your lore format, although it is added by default since 6.5+ * **%mmoitems_durability_bar_square%** returns the item durability as a progress bar.\
``` ![](https://i.imgur.com/HmS1wFR.png)
- '#durability#' * **%mmoitems_durability_bar_diamond%** returns the durability bar, but the char used is a diamond.\
``` ![](https://i.imgur.com/QPrLKtj.png)
Then add these lines to your stats.yml which are still part of the default config file since recent builds. * **%mmoitems_durability_bar_thin%** returns a much thiner durability bar.\
``` ![](https://i.imgur.com/MJvhd6S.png)
durability: '&7Durability: {current} / {max}'
``` ## Durability in item lore
As of 6.5+ you can display the item current and max durability in the item lore. Firstly, you would have to add the following line to your lore format, although it is added by default since 6.5+
```
- '#durability#'
```
Then add these lines to your stats.yml which are still part of the default config file since recent builds.
```
durability: '&7Durability: {current} / {max}'
```
![](https://i.imgur.com/InWJLD4.png) ![](https://i.imgur.com/InWJLD4.png)
\ No newline at end of file