toItemStack

fun Material.toItemStack(name: Component? = null, data: Map<NamespacedKey, DataWrapper<*, *>> = emptyMap()): ItemStack

Converts the material into an ItemStack, optionally setting the display name and persistent data.

Return

The created ItemStack with the specified properties applied.

Since

1.1.0

Author

RiriFa

Parameters

name

An optional display name for the resulting ItemStack. If null, no name will be set.

data

A map of NamespacedKey to DataWrapper, representing persistent data to attach to the ItemStack. Defaults to an empty map.