itemStack

fun itemStack(material: Material, amount: Int = 1, action: ItemStackBuilder.() -> Unit): ItemStack

Creates a new ItemStack using a DSL builder.

Example:

val item = itemStack(Material.DIAMOND, 64) {
displayName = Component.text("Shiny Diamonds")
lore(Component.text("Very valuable!"))
enchant(Enchantment.FORTUNE, 3)
}

Return

The configured ItemStack

Parameters

material

The material type for the ItemStack

amount

The stack size (default: 1)

action

The builder configuration lambda