Package-level declarations

Types

Link copied to clipboard

An attribute that can be applied to an item that modifies a specific attribute on an entity that has the item this attribute is applied to equipped.

Link copied to clipboard
fun interface ItemLike

Something that can be represented by an item.

Link copied to clipboard

The rarity of an item. This determines what colour the lore text appears as when the tooltip is read.

Link copied to clipboard

A stack of items in an inventory.

Link copied to clipboard
fun interface ItemStackLike

Something that can be represented by an item stack.

Link copied to clipboard
@CataloguedBy(catalogue = ItemTypes::class)
interface ItemType : ItemLike, BlockLike, Translatable, Keyed

Represents a type of item.

Link copied to clipboard
@Catalogue(type = ItemType::class)
object ItemTypes

This file is auto-generated. Do not edit this manually!

Functions

Link copied to clipboard
@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.

@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.

@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.

@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.

@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.

Link copied to clipboard
inline fun <I : ItemMeta> ItemStack.meta(): I?

Gets the metadata for this item stack as the given type I, or returns null if the metadata could not be casted to the given type I.

@Contract(value = "_ -> this", mutates = "this")
@JvmName(name = "metaGeneric")
inline fun <B : IMB<B, P>, P : IMP<B>, ItemMeta> ItemStack.Builder.meta(builder: B.() -> Unit): ItemStack.Builder
@Contract(value = "_ -> this", mutates = "this")
inline fun ItemStack.Builder.meta(builder: ItemMeta.Builder.() -> Unit): ItemStack.Builder

Applies the given builder function to the metadata builder for this builder.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
@JvmName(name = "withMetaGeneric")
inline fun <B : IMB<B, P>, P : IMP<B>, ItemMeta> ItemStack.withMeta(builder: B.() -> Unit): ItemStack

Creates a new item stack with meta retrieved applying the given builder to a new meta builder created with the given type P.

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

Creates a new item stack with meta retrieved applying the given builder to a new item metadata builder.