Package-level declarations

ItemStack builder and ItemStack modification extensions

Functions

Link copied to clipboard
inline fun itemStack(item: ItemLike, amount: Int = 1, builder: ItemStack.() -> Unit): ItemStack

A utility function for building complex item stacks with the given amount.

Link copied to clipboard
inline fun ItemStack.setCustomName(baseText: String? = null, builder: LiteralTextBuilder.() -> Unit = {})

Opens a LiteralTextBuilder to change the custom name of the item stack. Sets DataComponents.CUSTOM_NAME.

Link copied to clipboard
inline fun ItemStack.setItemName(baseText: String? = null, builder: LiteralTextBuilder.() -> Unit = {})

Opens a LiteralTextBuilder to change the minecraft:item_name item component of the item stack. Names set by minecraft:item_name would behave as the default name of this item (for example it will not show up when hovering an item frame with this item stack in it). Sets DataComponents.ITEM_NAME.

Link copied to clipboard
fun ItemStack.setLore(text: Collection<Component>)

Sets the item lore, which is displayed below the display name of the item stack. Each element of the text collection represents one line.

Link copied to clipboard
fun ItemStack.setPotion(potionHolder: Holder<Potion>)

Sets the given potion for this ItemStack.

fun ItemStack.setPotion(potion: Potion)
Link copied to clipboard
fun ItemStack.setSkullPlayer(player: ServerPlayer)

Configures the minecraft:profile item component to represent the given player (specified via uuid in its game profile).

Link copied to clipboard
fun ItemStack.setSkullTexture(texture: String? = null, uuid: UUID? = null, name: String? = null)

Configures the minecraft:profile item component to have the given texture. It can be provided via texture, uuid or name. If provided, the texture has to be base64 encoded.