Durability

Discussion in 'Plugin Development' started by Danelli, Dec 10, 2013.

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

    Danelli

    So I seem to have encountered a small bug while creating a plugin. I wish for spades the player is holding to only lose one durability in a EntityDamageByEntityEvent (by default they lose two). Unbreaking does not work for this task. Neither does p.getItemInHand().setDurability((short)(p.getItemInHand().getDurability() -1));

    Any ideas? I could put a 1 tick delay if nothing else is found, but I want to see alternative suggestions first :p
     
  2. Offline

    The_Doctor_123

    To decrease durability, add to the metadata value, not subtract.
     
Thread Status:
Not open for further replies.

Share This Page