How to add something to a List<String>

Discussion in 'Plugin Development' started by william9518, Jan 11, 2013.

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

    william9518

    so I want to use ItemMeta to add a lore but the setLore() method only allows List<String> I want the method to ADD 1 to the item's lore not set the whole thing how can i do that
     
  2. Offline

    tommycake50

    ItemMeta im = ItemStack.getItemMeta();
    List<String> l = im.getLore();
    l.add("Whatever");
    im.setLore(l);
    Itemstack.setItemMeta(im);
     
    Ne0nx3r0 likes this.
  3. Offline

    microgeek

    Learning the basics of Java before trying to program with it tends to help.

    .getLore().add("");
     
Thread Status:
Not open for further replies.

Share This Page