ItemStackBuilder
A DSL builder for creating and modifying ItemStacks in a declarative way.
This builder provides a type-safe way to configure ItemStack properties including:
Display name and lore
Enchantments
Item flags
Attributes
Custom model data
Example usage:
val sword = itemStack(Material.DIAMOND_SWORD) {
displayName = Component.text("Legendary Sword")
lore(
Component.text("A powerful weapon"),
Component.text("Forged in ancient times")
)
enchant(Enchantment.SHARPNESS, 5)
hideAll()
}Content copied to clipboard
Throws
if the ItemStack's ItemMeta is null