Get ItemStack from "Special" ID

Discussion in 'Plugin Development' started by Croug, Jun 30, 2013.

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

    Croug

    I would simply like to know how to get an ItemStack of the ID 5:3, I have tried loading a value from a yaml configuration(5:3) and the using ItemStack add = new ItemStack(id, 1); but it wont get the correct item.
     
  2. Offline

    Rprrr

    Croug
    You need to add a third value (a short). For example, new ItemStack(5, 1, (short) 3);.

    ItemStack (final int type, final int amount, final short damage)
    An item stack with the specified damage / durability.
     
  3. Offline

    Croug

    That worked, I used regex to parse the yaml string and was able to get it thanks a lot!
     
Thread Status:
Not open for further replies.

Share This Page