I have the ItemStack, how to I determine its sub type?

Discussion in 'Plugin Development' started by hpdvs2, Aug 22, 2012.

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

    hpdvs2

    Hello, I have an ItemStack (obtained from Inventory from a Chest), and I can see what material type it is, like wool, or wood. How can I determine the subtype, like Blue Wool or Spruce Wood? The id numbers are fine/preferred. Thanks.
     
  2. Offline

    skore87

    All types of wool have the same type and id, what differs is their data or damage value.
     
  3. Offline

    hpdvs2

    Awsome,

    itemStackVariable.getData().GetData()

    returns the byte value for the item type. Thanks.
     
  4. I recommend using getDurability(), it's the same value as a short and allows comparing against larger values... critical for comparing potion data values.... and it's also one single call, not two :p
     
Thread Status:
Not open for further replies.

Share This Page