How to disable durability?

Discussion in 'Plugin Development' started by born2kill_, Jul 4, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    born2kill_

    I'm making a KitPVP server and one of the main problem is durability. I set my leather armour kits to have unbreaking 10, yet they still break really quick. Is there a way to disable durability altogether?
     
  2. Offline

    RingOfStorms

    Listen for damage events and set the durability of the item in the damager's hand to 0.
     
  3. Offline

    valon750

    born2kill_

    You say this is PVP, so EntityDamageByEntityEvent will be triggered often, I'd say have it loop through the armour, setting its durability to 0. You most likely need to use player.updateInventory() also.
     
  4. Offline

    CynutsBR

    Simple, on damage get d playa inv then get d bots, chest, helm, leggings and do setdurabilitty(getdurability + 1).. Or something like dis
     
  5. Offline

    NathanWolf

    If you're willing to dig into NMS and NBT, the Unbreakable tag will do just what you what.

    You can actually just use /give for this if you don't want code it.
     
  6. Offline

    RingOfStorms

    Yes, this would work if you want the item to break twice as fast.
    Just set the durability to 0
     
  7. Offline

    Konato_K

    Once I saw in someone's documentation that you can set the durability of an ItemStack to a negative value and works.
     
Thread Status:
Not open for further replies.

Share This Page