Class ItemBuilder

java.lang.Object
studio.mevera.lotus.api.item.AbstractItemBuilder<ItemBuilder,net.kyori.adventure.text.Component>
studio.mevera.lotus.paper.ItemBuilder

public final class ItemBuilder extends studio.mevera.lotus.api.item.AbstractItemBuilder<ItemBuilder,net.kyori.adventure.text.Component>
Paper 1.21+ fluent ItemStack builder with Adventure Component display names and lore. Extends AbstractItemBuilder with C = Component.

Uses the Paper 1.21+ API:

  • ItemStack.of(Material) for construction
  • ItemStack.editMeta(java.util.function.Consumer) for meta mutation
  • meta.displayName(Component) and meta.lore(List<Component>) for Adventure fidelity
  • meta.setUnbreakable(true) for the unbreakable flag

Usage:


 ItemStack item = ItemBuilder.of(Material.DIAMOND)
     .displayName(Component.text("Legendary Gem").color(NamedTextColor.AQUA))
     .lore(List.of(Component.text("Rare find").color(NamedTextColor.GRAY)))
     .amount(3)
     .unbreakable(true)
     .build();
 
  • Field Summary

    Fields inherited from class studio.mevera.lotus.api.item.AbstractItemBuilder

    amount, material, unbreakable
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.inventory.ItemStack
     
    @NotNull ItemBuilder
    displayName(@NotNull net.kyori.adventure.text.Component name)
     
    @NotNull ItemBuilder
    lore(@NotNull List<net.kyori.adventure.text.Component> lines)
     
    static @NotNull ItemBuilder
    of(@NotNull org.bukkit.Material material)
     

    Methods inherited from class studio.mevera.lotus.api.item.AbstractItemBuilder

    amount, lore, self, unbreakable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      @NotNull public static @NotNull ItemBuilder of(@NotNull @NotNull org.bukkit.Material material)
    • displayName

      @NotNull public @NotNull ItemBuilder displayName(@NotNull @NotNull net.kyori.adventure.text.Component name)
      Specified by:
      displayName in class studio.mevera.lotus.api.item.AbstractItemBuilder<ItemBuilder,net.kyori.adventure.text.Component>
    • lore

      @NotNull public @NotNull ItemBuilder lore(@NotNull @NotNull List<net.kyori.adventure.text.Component> lines)
      Specified by:
      lore in class studio.mevera.lotus.api.item.AbstractItemBuilder<ItemBuilder,net.kyori.adventure.text.Component>
    • build

      @NotNull public @NotNull org.bukkit.inventory.ItemStack build()
      Specified by:
      build in class studio.mevera.lotus.api.item.AbstractItemBuilder<ItemBuilder,net.kyori.adventure.text.Component>