ItemType

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

Represents a type of item.

Functions

Link copied to clipboard
abstract fun asBlock(): Block

Gets the block representation, or null if there is no block representation.

Link copied to clipboard
open override fun asItem(): ItemType

Converts this object to its item representation.

Link copied to clipboard
@NotNull
abstract fun key(): @NotNull Key
Link copied to clipboard
@NotNull
abstract fun translationKey(): @NotNull String

Properties

Link copied to clipboard
@get:JvmName(name = "canBreak")
abstract val canBreak: Boolean

If items of this type actually take damage when they use or break blocks.

Link copied to clipboard
@get:JvmName(name = "drinkingSound")
abstract val drinkingSound: SoundEvent

The sound that items of this type will make when they are drank.

Link copied to clipboard
@get:JvmName(name = "durability")
abstract val durability: Int

The maximum amount of things items of this type can use/break before they break.

Link copied to clipboard
@get:JvmName(name = "eatingSound")
abstract val eatingSound: SoundEvent

The sound that items of this type will make when they are eaten.

Link copied to clipboard
abstract val isEdible: Boolean

If items of this type can be eaten.

Link copied to clipboard
abstract val isFireResistant: Boolean

If items of this type are resistant to fire, meaning they won't burn up when thrown in to any source of fire, such as standard fire or lava.

Link copied to clipboard
@get:JvmName(name = "maximumStackSize")
abstract val maximumStackSize: Int

The maximum amount of this item type that can be stacked in a single item stack.

Link copied to clipboard
@get:JvmName(name = "rarity")
abstract val rarity: ItemRarity

The rarity of the item.