MCPcopy Create free account
hub / github.com/Teneted/Tenet / setDurability

Method setDurability

src/main/java/org/bukkit/inventory/ItemStack.java:210–217  ·  view source on GitHub ↗

Sets the durability of this item @param durability Durability of this item @deprecated durability is now part of ItemMeta. To avoid confusion and misuse, #getItemMeta(), #setItemMeta(ItemMeta) and Damageable#setDamage(int) should be used instead. This is because any call to

(final short durability)

Source from the content-addressed store, hash-verified

208 * ItemMeta which was created before this call.
209 */
210 @Deprecated
211 public void setDurability(final short durability) {
212 ItemMeta meta = getItemMeta();
213 if (meta != null) {
214 ((Damageable) meta).setDamage(durability);
215 setItemMeta(meta);
216 }
217 }
218
219 /**
220 * Gets the durability of this item

Callers 3

ItemStackMethod · 0.95
deserializeMethod · 0.95
getItemStackMethod · 0.95

Calls 3

getItemMetaMethod · 0.95
setItemMetaMethod · 0.95
setDamageMethod · 0.65

Tested by

no test coverage detected