Solved Make Lore not Italic

Discussion in 'Plugin Development' started by Smeary_Subset, Aug 31, 2024.

  1. Offline

    Smeary_Subset

    How can I make item lore not in italics? Here's my code and it makes the text decoration italic by default.

    Code:
    player = (Player) sender;
    
            ItemStack itemStack = new ItemStack(Material.IRON_HOE);
            ItemMeta meta = itemStack.getItemMeta();
    
            List<TextComponent> lore = new ArrayList<>();
            lore.add(Component.text("Test", NamedTextColor.GRAY));
    
            meta.lore(lore);
            itemStack.setItemMeta(meta);
    
            player.getInventory().addItem(itemStack);

    Result:

    upload_2024-8-31_18-38-20.png
     
  2. Offline

    KarimAKL

  3. Offline

    Smeary_Subset

  4. Offline

    KarimAKL

    Yes. Paper makes use of the Adventure API natively. The Adventure API is what provides you with Component and such.
     
  5. Offline

    Smeary_Subset

    Got it, thanks! Always wondered why the packages had Adventure in their name. Also, you're solution worked. Thank you
     
    KarimAKL likes this.

Share This Page