getMaxDurability of Material

Discussion in 'Plugin Development' started by Jonbas, Mar 15, 2011.

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

    Jonbas

    Can someone help me understand how a materials max durability works?

    I'm testing on a wood sword and the items durability goes from 0 - 59 where at 59 it breaks. When I check Material.WOODEN_SWORD.getMaxDurability(); it returns 59.

    But when I check Material.IRON_SWORD.getMaxDurability, it also returns 59, when the item itself quickly goes over 60+ durability without even having the damage bar go yellow.

    Is there a modifier or scaling factor here somewhere that I'm not seeing?

    Thanks,
     
  2. Offline

    Edward Hand

    It seems to be a peculiarity with IronSword only.

    If you look in the org.bukkit.Material class you can track where those values get set. All wood tools have durability 59. All iron tools are 250 (except sword). Daimond/stone swords have the same durability as the rest of the tools of their material. From that I'm assuming it's just a mistake in the definition.
     
  3. Offline

    Jonbas

    Ahh! Thank you. Just my luck I had to choose the one with a bug to test on.
     
Thread Status:
Not open for further replies.

Share This Page