Solved Coloring leather armor Bukkit 1.4.6

Discussion in 'Plugin Development' started by MineCrypt, Dec 24, 2012.

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

    MineCrypt

    Alright I need a way to color armor in bukkit for a plugin I am making, I have found this bit of code here:
    Code:
    public void setColor(ItemStack is, Color color){
    LeatherArmorMeta lam = (LeatherArmorMeta)is.getItemMeta();
    lam.setColor(color);
    is.setItemMeta(lam);
    }
    But sadly I do not know how to use it, Can someone show me the method to give the armor to the player colored?
     
  2. Offline

    fireblast709

    Code:
    ItemStack lhemlet = new ItemStack(Material.LEATHER_HELMET, 1);
    setColor(lhelmet, Color.<somecolour>);
    player.getInventory().addItem(lhelmet);
     
  3. Offline

    MineCrypt

    Alright thanks! now If you would maybe know one more thing, I have the code for skulls and color but do you know the code for changing the name of an item and also adding description? that would be amazing

    Alright forget about the setting names I figured that out, but descriptions idk.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  4. Offline

    fireblast709

    ItemMeta's setLore(List<String>) and getLore()
     
Thread Status:
Not open for further replies.

Share This Page