Solved How to add "\n" to item lore?

Discussion in 'Plugin Development' started by stazek, May 7, 2020.

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

    stazek

    I want to add "\n" to item lore. This is a fragment of my code. What should I do?
    Code:
    public void KupZbr1(Player player){
    player.closeInventory();
    ItemStack zbr1 = new ItemStack(Material.LEATHER_CHESTPLATE);
    Inventory gui = Bukkit.createInventory(null, 9, ChatColor.GOLD + "Wez swoja zbroje wojowniku :)");
    //Zbroja pierwszaItemMeta zbr1Meta = zbr1.getItemMeta();
    zbr1Meta.setLore(null);
    zbr1Meta.setDisplayName(null);
    zbr1lore.add(ChatColor.DARK_BLUE + "Chyba nie myslales ze bedziesz biegal nago.");
    zbr1Meta.setDisplayName("SKORZANA TUNIKA ");
    zbr1Meta.setLore(zbr1lore);
    zbr1Meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, true);
    zbr1Meta.isUnbreakable();
    zbr1.setItemMeta(zbr1Meta);
    gui.setItem(4, zbr1);
    player.openInventory(gui);
    
    }
     
    Last edited by a moderator: May 7, 2020
  2. Offline

    timtower Administrator Administrator Moderator

    @stazek Please use [code] < code here > [/code] instead of just posting it.
    And add another line to the lore.
     
  3. Offline

    stazek

    Ok. Thanks
     
  4. Offline

    seklyza

    Uhm.... I don't know if I understand you right... But maybe add another item to the lore list?
    Code:
    zbr1lore.add("Another line");
    
    EDIT: Typo
     
Thread Status:
Not open for further replies.

Share This Page