I'm currently trying to write a plugin that makes tools indestructible. Spigot 1.8 I tried to cancel the PlayerItemDamageEvent and tried with e.getItem (). SetDurability (e.getItem (). GetType (). GetMaxDurability ()); to reset the shelf life. Neither works. How do I make the tools and armor not lose durability?
ItemStack is = event.getItem ();
ItemMeta i'm = is.getItemMeta ();
i'm.spigot (). SetUnbreakable (true);
is.setItemMeta (i'm);
And with every item
For me it doesn't look right (otherwise an idea?): See the question above.
What do you want exactly? Certainly make items feasible or all?
All
So actually the proposal from xJesus works. What's the problem?
The pick loses durability and the texture of the sword is forbidden after the first damage
So actually it should work.
Did you spell everything correctly?
Is there an error in the console?
Yes it is typed correctly and the console does not issue an error message.
Then something is wrong with your Minecraft. Also the plugin on it and reloaded?
Minecraft agrees I have two devices on which both the problem appears, plugin is reloaded and server restarted.
Which MC version?
Java 1.8 as written above.