Changing Glass Pane Color

Discussion in 'Plugin Development' started by Newclear97, Jun 21, 2017.

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

    Newclear97

    I am making a Inventory plugin and i am wanting to make the Stained Glass Panes different color.

    If anyone can help me please do!

    Heres my Code: https://hastebin.com/hoxiwofiki.java

    if you can correct it then comment it that would be great thanks!
     
  2. Offline

    Zombie_Striker

    @Newclear97
    To change the color of the pane, change the item durability.
     
  3. Offline

    Newclear97

    Thats the thing, I dont know how!
     
  4. Offline

    Zombie_Striker

  5. Offline

    Newclear97

    Where do i add that!
     
  6. Offline

    Zombie_Striker

    @Newclear97
    Where ever you want to change the color of the itemstack. Most likely, this should be in the itemstack creation method,
     
  7. Offline

    Iran

    You can also do this to make a colored glass pane.

    Code:
    ItemStack item = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 0-15);
    
     
  8. Just as a tip by 0-15 @Zombie_Striker means a value from 0 to 15 for example 3 so don't literally put that like in @Iran 's example
     
  9. Offline

    Newclear97

    Code:
        public static void createDisplay(Material mat, Inventory inv, int Slot, String name, String lore, short durability) {
            ItemStack item = new ItemStack(mat);
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName(name);
            meta.setLore(Arrays.asList(lore));
            item.setItemMeta(meta);
            item.setDurability(durability);
            inv.setItem(Slot, item);
    Found it out, Thats how you do it! Well, Thats how i found out anyway!
     
Thread Status:
Not open for further replies.

Share This Page