Colored Thin Glass?

Discussion in 'Plugin Development' started by Stackore, Mar 30, 2014.

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

    Stackore

    How do i make colored glass planes?
    Here is my code:
    Code:java
    1. ItemStack vip = new ItemStack(Material.THIN_GLASS, 1);
    2. ItemMeta vipmeta = vip.getItemMeta();
    3. vipmeta.setDisplayName(ChatColor.GREEN + "" + ChatColor.ITALIC + "Yes");
    4. vip.setItemMeta(vipmeta);


    Realy need green colored glass planes :(
     
  2. Offline

    Norbu10


    Code:java
    1. vipmeta.setByte((byte) 5);
    or
    Code:java
    1. vip.setByte((byte) 5);
     
  3. Offline

    Stackore

    Can't get it work, vip.setByte does not exist
     
  4. Offline

    The Fancy Whale

    I believe you have to set the durability
     
    AoH_Ruthless likes this.
  5. Offline

    Scizzr

    That would be correct. For now, at least, durability is for block sub-ids as well as item durability.
     
  6. Offline

    Zach_1919

    Stackore Oh don't listen to their crazy methods. Just change this:
    Code:java
    1. ItemStack vip = new ItemStack(Material.THIN_GLASS, 1);

    To this:
    Code:java
    1. ItemStack vip = new ItemStack(Material.THIN_GLASS, 1, (short) 5);

    You can change the 5 to whatever data value you want :)
     
  7. Offline

    The Fancy Whale

    Zach_1919 What are you talking about crazy methods? You use setDurability...
     
  8. Offline

    Zach_1919

  9. Offline

    The Fancy Whale

    That method doesn't work as far as I know
     
  10. Offline

    Zach_1919

Thread Status:
Not open for further replies.

Share This Page