Max data/damage value of itemstack

Discussion in 'Plugin Development' started by elementalgodz11, Oct 19, 2014.

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


    Hello, I'm looking for a way to get the maximum damage value of an ItemStack or Material.

    For example, there are only 16 variants of a Wool Material, so the max data value of wool would by 16.

    What I've tried:
    • Looping variable i from 0 to 64, creating a new ItemStack with the durability of i checking if its null or whatnot.
    • materialType.getMaxDurability() - This just returns 0.
    I can't find any other methods in the API that allow you to do this either?

  2. Offline


    I could be entirely wrong on this, but the durability, according to the Material enum, is literally the durability of the Material. Meaning only tools which can be damaged have durability.

    I think that what you're looking for is Material#getData, which returns MaterialData.
  3. Offline


    elementalgodz11 theres an enum called DyeColor that could probably be used here.
Thread Status:
Not open for further replies.

Share This Page