Item

class Item

Constructors

Link copied to clipboard
fun Item(itemStack: ItemStack)
Link copied to clipboard
fun Item(itemName: String)
Link copied to clipboard
fun Item(itemID: Int)
Link copied to clipboard
fun Item(block: BlockType)
Link copied to clipboard
fun Item(entityItem: EntityItem)
Link copied to clipboard
fun Item(entity: Entity)

Create an Item object from an Entity. Has to be wrapping an EntityItem.

Functions

Link copied to clipboard
fun canDestroy(block: BlockType): Boolean
Link copied to clipboard
fun canHarvest(block: BlockType): Boolean
Link copied to clipboard
fun canPlaceOn(block: BlockType): Boolean
Link copied to clipboard
fun draw(x: Float = 0.0f, y: Float = 0.0f, scale: Float = 1.0f, z: Float = 200.0f)

Renders the item icon to the client's overlay, with customizable overlay information.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks whether another Item is the same as this one. It compares id, stack size, and durability.

Link copied to clipboard
fun getDamage(): Int
Link copied to clipboard
fun getDurability(): Int

Gets the item's durability, i.e. the number of uses left

Link copied to clipboard
fun getEnchantments(): Map<String, Int>
Link copied to clipboard
fun getID(): Int
Link copied to clipboard
fun getItemNBT(): NBTTagCompound
Link copied to clipboard
fun getLore(): List<String>

Gets the item's name and lore lines.

Link copied to clipboard
fun getMaxDamage(): Int
Link copied to clipboard
fun getMetadata(): Int
Link copied to clipboard
fun getName(): String

Gets the item's stack display name. Example: Oak Wood Planks

Link copied to clipboard
fun getNBT(): NBTTagCompound
Link copied to clipboard
fun getRawNBT(): String
Link copied to clipboard
fun getRegistryName(): String

Gets the item's registry name. Example: minecraft:planks

Link copied to clipboard
fun getStackSize(): Int
Link copied to clipboard
fun getTextComponent(): TextComponent
Link copied to clipboard
fun getUnlocalizedName(): String

Gets the item's unlocalized name. Example: tile.wood

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isDamagable(): Boolean
Link copied to clipboard
fun isEnchantable(): Boolean
Link copied to clipboard
fun isEnchanted(): Boolean
Link copied to clipboard
fun setDamage(damage: Int): Item
Link copied to clipboard
fun setLore(vararg loreLines: String): Item

Sets the item's lore. Does not set the item's name, use setName instead.

Link copied to clipboard
fun setName(name: String): Item

Sets the item's name.

Link copied to clipboard
fun setStackSize(stackSize: Int): Item
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val item: MCItem
Link copied to clipboard
var itemStack: ItemStack

Sources

Link copied to clipboard