# net.axay.kspigot.items

# Package net.axay.kspigot.items

## Types

CustomItemIdentifier
Link copied to clipboard

This class defines a material in combination with a specific custom model data value.

It is useful if you work with custom items defined in resourcepacks, where you do not only need a material to define a specific item type, but the value of the custom model data aswell.

data class CustomItemIdentifier(customModelData: Int, placeHolderMaterial: Material)
Content copied to clipboard
ItemMetaLoreBuilder
Link copied to clipboard

Lore builder which uses an ArrayList under the hood. It exists to provide overloaded operator functions.

class ItemMetaLoreBuilder
Content copied to clipboard

## Functions

addLore
Link copied to clipboard

Adds new lines to the lore (description) of the item.

inline fun ItemMeta.addLore(builder: ItemMetaLoreBuilder.() -> Unit)
Content copied to clipboard
flag
Link copied to clipboard

Add a new ItemFlag to the item flags.

fun ItemMeta.flag(itemFlag: ItemFlag)
Content copied to clipboard
flags
Link copied to clipboard

Add several ItemFlags to the item flags.

fun ItemMeta.flags(vararg itemFlag: Array<out ItemFlag>)
Content copied to clipboard
itemMeta
Link copied to clipboard

Creates new a ItemMeta instance of the given material and opens a builder for it.

inline fun <T : ItemMeta> itemMeta(material: Material, builder: T.() -> Unit): T?
Content copied to clipboard
@JvmName(name = "simpleItemMeta")
inline fun itemMeta(material: Material, builder: ItemMeta.() -> Unit): ItemMeta?
Content copied to clipboard
itemStack
Link copied to clipboard

Creates a new ItemStack and opens a builder for it.

inline fun itemStack(material: Material, builder: ItemStack.() -> Unit): ItemStack
Content copied to clipboard
meta
Link copied to clipboard

Opens a builder with the current meta.

inline fun <T : ItemMeta> ItemStack.meta(builder: T.() -> Unit)
Content copied to clipboard
@JvmName(name = "simpleMeta")
inline fun ItemStack.meta(builder: ItemMeta.() -> Unit)
Content copied to clipboard
removeFlag
Link copied to clipboard

Removes a ItemFlag from the item flags.

fun ItemMeta.removeFlag(itemFlag: ItemFlag)
Content copied to clipboard
removeFlags
Link copied to clipboard

Removes several ItemFlags from the item flags.

fun ItemMeta.removeFlags(vararg itemFlag: Array<out ItemFlag>)
Content copied to clipboard
setLore
Link copied to clipboard

Sets the lore (description) of the item.

inline fun ItemMeta.setLore(builder: ItemMetaLoreBuilder.() -> Unit)
Content copied to clipboard
setMeta
Link copied to clipboard

Resets the meta and opens a builder to create the new one.

inline fun <T : ItemMeta> ItemStack.setMeta(builder: T.() -> Unit)
Content copied to clipboard
@JvmName(name = "simpleSetMeta")
inline fun ItemStack.setMeta(builder: ItemMeta.() -> Unit)
Content copied to clipboard

## Properties

customModel
Link copied to clipboard

Provides safe access to the items' customModelData.

var ItemMeta.customModel: Int?
Content copied to clipboard
localName
Link copied to clipboard

Provides more consistent access to the items' localizedName.

var ItemMeta.localName: String
Content copied to clipboard
name
Link copied to clipboard

Provides safe access to the items' displayName.

var ItemMeta.name: String?
Content copied to clipboard