Glass pane

Discussion in 'Spigot Plugin Development' started by BiastGaming, May 25, 2016.

  1. How would I create a coloured glass pane?
     
  2. ItemStack#setDurability(short durability)

    For a red pane set it to 14
    For a green pane set it to 13
     
    • Informative Informative x 1
  3. So. Btw item utils is a class I have with methods for.making itemstacks.
    Code (Text):
    ItemStack holder = new ItemUtils.create holder(Material.GLASS, 1, "Not Available", Arrays.asLists(" You do not have permissions for this!",Purchase from /buy");
     
    The method is ItemUtils.createHolder(Material, amount, name, lore)

    Then I would do holder.setDurability(14)?
     
  4. you can also do

    Code (Java):
    ItemStack colored = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)14); // for red
    ItemStack colored = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)13) // for green
     
  5. you can use @ItsMonkey code to make a method or my code.

    Code (Java):
    public ItemStack createItemStack(int arg0, int arg1) {
       ItemStack stack = new ItemStack(Material.STAINED_GLASS_PANE, arg0, (short) arg1);
       return stack;
    }