ItemStack(material,amount,short,byte) What other form?

Discussion in 'Plugin Development' started by Gungsu, Jan 23, 2013.

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

    Gungsu

    What correct form, for create this item?

    Code:
    byte b = 3;
    short s = 1;
    @SuppressWarnings("deprecation")
    ItemStack sku = new ItemStack(Material.SKULL_ITEM,1,s,b);
     
  2. Offline

    Cjreek

    Code:
    ItemStack sku = new ItemStack(Material.SKULL_ITEM, 1, s);
    sku.setData(new MaterialData(Material.SKULL_ITEM, b);
     
  3. Offline

    fireblast709

    Code:
    new ItemStack(Material.SKULL_ITEM, 1, (short)b);
     
  4. Offline

    Gungsu

    thanks!
     
  5. Gungsu
    If you are using eclipse pressing CTRL + SPACE will show you suggestions. It helps for constructors because it tells you what data type is required for each parameter. If you are using another IDE i'm sure there'll be a similar feature you can use.
     
Thread Status:
Not open for further replies.

Share This Page