Solved Colored glass panes

Discussion in 'Spigot Plugin Development' started by DyrhoDevelopment, May 28, 2016.

Thread Status:
Not open for further replies.
  1. hey,
    Ive got a code for some nice glass panes in an inventory, but I want them to be blue.
    How can i fix this?

    this is my code as far as I am now.
    Code (Text):
        ItemStack panes = nameItem(Material.STAINED_GLASS_PANES, "divider");
    }

     
        private static ItemStack nameItem(ItemStack item, String name) {
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName(name);
         
            item.setItemMeta(meta);
            return item;
        }
     
        private static ItemStack nameItem(Material item, String name) {
            return nameItem(new ItemStack(item), name);
        }
    Thank you for helping!
     
  2. Code (Text):
    item.setDurability((short) 3);
    the durability of a light blue glass pane is 3 a blue one is 11
     
  3. Some items, like glass panes and colored clay blocks, carry a data value as well as a Material value. It looks like 11 is the data value you're looking for here (wiki).

    So:
    Code (Text):
    new ItemStack(Material.STAINED_GLASS_PANE, 1, (byte)11)
     
Thread Status:
Not open for further replies.