(ItemStack).setDurability() not working correctly?

Discussion in 'Plugin Development' started by tytwining, Jun 17, 2015.

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

    tytwining

    I've been stressing over this weird issue where setDurability will not work. This is the code(I'm trying to repair the tool completely):
    Code:
    i.setDurability((short) 0)
    And that code works, but it outputs an error as well. It outputs a NullPointerException on the same line of code that that is on.
     
  2. Offline

    bendbassett

    new Short(0)
     
  3. Offline

    Konato_K

  4. Offline

    tytwining

    Hah... Wow. That was a huge failure from me. I forgot to add if(i != null)....
     
Thread Status:
Not open for further replies.

Share This Page