How to set DataTag for ItemStack?

Discussion in 'Plugin Development' started by ThePandaPlayer, Aug 28, 2017.

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

    ThePandaPlayer

    (OMG like my 5th question I'm so bad at Bukkit) How would I set a DataTag for any ItemStack. A Material.STAINED_GLASS_PANE in particular. I want to change its color. How would I do that? Here is what I have come up with :
    Code:
    short color = 5;
               
    ItemStack glassPaneGreen = new ItemStack(Material.STAINED_GLASS_PANE, 64, color );
    Would this work?
     
  2. Offline

    Zombie_Striker

  3. Offline

    ThePandaPlayer

    @Zombie_Striker
    Okay, nice to know I got it on the first try. I had checked the JavaDocs before for this, and I just wanted to double check with people who know bukkit better than I do. (The JavaDoc is actually my goto for method parameters)
     
Thread Status:
Not open for further replies.

Share This Page