ItemUtils

object ItemUtils

Functions

Link copied to clipboard
fun getId(itemStack: ItemStack): String

Gets the id of the given itemStack.

Link copied to clipboard
fun getItemStack(s: String): ItemStack

Creates an ItemStack from the given String. Resolves ids from vanilla, nova and custom item services. Can also parse snbt.

fun getItemStack(id: ResourceLocation): ItemStack

Creates an ItemStack from the given id. Resolves ids from vanilla, nova and custom item services.

Link copied to clipboard
fun getName(itemStack: ItemStack): Component

Gets the actually displayed name of the given itemStack. If the itemStack has a custom display name, that will be returned. Otherwise, the localized name will be returned.

Link copied to clipboard
fun getRecipeChoice(nameList: List<String>): RecipeChoice
Link copied to clipboard
Link copied to clipboard
fun toItemStack(s: String): ItemStack

Converts the given string to an ItemStack. Does not understand custom item ids.