Creating A Color For A Leather Helmet

Discussion in 'Spigot Plugin Development' started by ItsWill, May 16, 2015.

  1. This is the code I've got so far:
    PHP:
    ItemStack helmet = new ItemStack (Material.LEATHER_HELMET);
            LeatherArmorMeta meta = (LeatherArmorMeta) helmet.getItemMeta();
            ArrayList<String> tt = new ArrayList<String>();
            meta.setDisplayName("Helmet");
            tt.add(ChatColor.BOLD + "Lore");
            tt.add(ChatColor.RED + "Lore1");
            meta.setLore(tt);
            helmet.setColor(Color.LIME);
            helmet.setItemMeta(meta);
    The
    Code (Text):
    helmet.setColor(Color.LIME);
    does not work, it comes up with an error. I'm copying the Dyed Armor tutorial by PogoStick29Dev. Maybe it's old?
     
  2. mm, should work fine.
    https://hub.spigotmc.org/javadocs/b...therArmorMeta.html#setColor(org.bukkit.Color)

    post error please.
    haha, just noticed.

    @mansionwill, you should be doing meta.setColor(color);
     
  3. ItemStack#setColor() does not exist.
     
  4. Are you looking for something like this? :
    Code (Text):
    ItemStack legs = new ItemStack(Material.LEATHER_LEGGINGS);
            LeatherArmorMeta legsmeta = (LeatherArmorMeta) legs.getItemMeta();
            legsmeta.setColor(Color.WHITE);
            legs.setItemMeta(legsmeta);
           
    (working for me)
     
  5. Yeah, lel. I just found out. Sorry, it was dumb for me to post it on the forums to early.