Colored glass?

Discussion in 'Plugin Development' started by FreakyPear5, Mar 24, 2020.

Thread Status:
Not open for further replies.
  1. I am making a GUI with different selections and I want to have those options in glass panes. How do I change the color of the glass? I tried (short) but that didn't work. I need to get the color from the Config.
    The lines I was trying to use to do this are as follows:

    Class:
    String redblocktype = Main.getPlugin(Main.class).getConfig().getString("red.block");
    String[] redtype = redblocktype.split(":");
    ItemStack red = new ItemStack(Material.getMaterial(redtype[0]), (short)Integer.parseInt(redtype[1]));

    Config:
    red:
    name: "&c%player%"
    block: "STAINED_GLASS_PANE:14"
    loc: 12

    I would be grateful for anything you can help me with!
    Thanks!
     
  2. Offline

    KarimAKL

  3. @KarimAKL I tried (byte) but that doesn't work either. Which one am I supposed to use?
     
  4. Offline

    CraftCreeper6

    @FreakyPear5
    No, the second argument for an itemstack is the amount of the item. You need to add a 3rd argument to change the byte data.
     
  5. Oh, ok. Thanks :)
     
Thread Status:
Not open for further replies.

Share This Page