Edit default item lore

Discussion in 'Plugin Development' started by boniomri, Jun 25, 2014.

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

    boniomri

    I basically want to have a specific lore for an item, meaning is lets say I want a diamond sword. So I can get it from crafting/dungeons/creative menu etc etc.
    What I basically want is to have a default lore for an item, meaning is that you wont be able to find a sword without the lore I set up.
    Sorry for the poor explanation.
     
  2. Offline

    jthort

    boniomri Is this what your looking for?

    Code:
    ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
    ItemMeta im = item.getItemMeta();
    im.setDisplayName(ChatColor.COLOR_NAME + "displayName");
    List<String> loreList = new ArrayList<String>();
    loreList.add(ChatColor.COLOR_NAME + "lore");//This is the first line of lore
    loreList.add(ChatColor.COLOR_NAME + "lore2");//This is the second line of lore
    im.setLore(loreList);
    item.setItemMeta(im);
    I don't player minecraft much but I don't think players can make a different colored lore so they can't be duplicated
     
  3. Offline

    Konkz

    Listen to player pickup & craft event and if it's equal to a, for example, wooden sword, set the items lore and give that item.
     
Thread Status:
Not open for further replies.

Share This Page