Item Meta Lore?

Discussion in 'Plugin Development' started by Kyle FYI, Oct 20, 2013.

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

    Kyle FYI

    I'm trying to set a color to a lore in item meta but for some reason its not working. I tried putting &3 etc... It just echos that out on the page, I tried using ChatColor but that doesn't work as its in a list. So i'm unsure how to set the lores color. Thanks.
     
  2. Offline

    user_90854156

    Code:java
    1. lore.add(ChatColor.GREEN + "This lore got color");

    ChatColor works for me in my plugin.

    Try posting your code here.
     
  3. Offline

    Kyle FYI

    Code:java
    1. for(int i = 0; i < lore.size(); i++){
    2. String rep = lore.get(i);
    3. rep = color + lore;
    4. lore.set(i, rep);
    5. }
    6. item_meta.setLore(lore);
     
  4. Offline

    XvBaseballkidvX

    This is what I do:

    Code:java
    1. ItemStack item = new ItemStack(Material.DIAMOND);
    2. ItemMeta meta = item.getItemMeta();
    3. meta.setDisplayName("NAME");
    4. meta.setLore(Arrays.asList("Lore 1", "Lore 2", "Lore 3", "So on and so on"));
    5. item.setItemMeta(meta);



    You can also make a method if you are going to be using a lot of items with ItemMeta.
     
Thread Status:
Not open for further replies.

Share This Page