item

@Contract(value = "_ -> new", pure = true)
inline fun item(builder: ItemStack.Builder.() -> Unit): ItemStack

Creates a new item stack from the result of applying the given builder function.

Return

a new item stack

Parameters

builder

the builder


@Contract(value = "_, _ -> new", pure = true)
inline fun item(type: ItemType, builder: ItemStack.Builder.() -> Unit): ItemStack

Creates a new item stack with the given type and the result of applying the given builder function.

Return

a new item stack

Parameters

type

the item type

builder

the builder


@Contract(value = "_, _, _ -> new", pure = true)
inline fun item(type: ItemType, amount: Int, builder: ItemStack.Builder.() -> Unit): ItemStack

Creates a new item stack with the given type, amount, and the result of applying the given builder function.

Return

a new item stack

Parameters

type

the item type

amount

the amount of items

builder

the builder


@JvmName(name = "itemWithMeta")
@Contract(value = "_, _, _ -> new", pure = true)
inline fun item(type: ItemType, amount: Int, meta: ItemMeta.Builder.() -> Unit): ItemStack

Creates a new item stack with the given type, amount, and meta built from the given meta builder.

Return

a new item stack

Parameters

type

the item type

amount

the amount of items

meta

the meta builder


@JvmName(name = "itemWithMetaGeneric")
@Contract(value = "_, _, _ -> new", pure = true)
inline fun <B : ItemMetaBuilder<B, P>, P : ItemMetaBuilder.Provider<B>, ItemMeta> item(type: ItemType, amount: Int, meta: B.() -> Unit): ItemStack

Creates a new item stack with the given type, amount, and meta of the given type P built from the given meta builder of the given type B.

Return

a new item stack

Parameters

B

the type of the metadata builder

P

the type of the metadata

type

the item type

amount

the amount of items

meta

the meta builder