Making Gold better than Diamond

Discussion in 'Spigot Help' started by DaneOle04, Jan 26, 2020.

  1. Hey, I was wondering if there is a way to change the durability of all gold tools, without adding an enchantment so they can still use an enchanting table. I want to change the durability to be the same as diamond.
     
  2. I could be wrong, but Im about 97.58% sure the max durability of an item is hard coded.
     
  3. With some math you could evaluate the chance to add to not take damage so the durability will decrease slower and maybe have some kind of similarity with the diamond ^^
     
  4. So for poops and hahas I decided to change the max durability of gold tools on the server to 2000, which in a sense works, the tool won't break, but it appears the visual max durability is hard coded on the client:

    [​IMG]
     
  5. How did you do that?
     
  6. I edited the code in Craftbukkit(you can do the same with Spigot, I just had CB available because I was doing a PR last night), built it, ran it, and then just gave myself a shovel.
     
  7. You could try this: make the item unbreakable and hide the flag, then set a max durability constant somewhere in your plugin and then on certain amounts of use decrease the actual durability to make it look like the tool is taking damage. Although since you want players to still be able to add enchants, you would have to factor in unbreaking 1-3 in that as well.