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)
ItemMetaLoreBuilder
Link copied to clipboard

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

class ItemMetaLoreBuilder

Functions

addLore
Link copied to clipboard

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

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

Add a new ItemFlag to the item flags.

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

Add several ItemFlags to the item flags.

fun ItemMeta.flags(vararg itemFlag: Array<out ItemFlag>)
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?
@JvmName(name = "simpleItemMeta")
inline fun itemMeta(material: Material, builder: ItemMeta.() -> Unit): ItemMeta?
itemStack
Link copied to clipboard

Creates a new ItemStack and opens a builder for it.

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

Opens a builder with the current meta.

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

Removes a ItemFlag from the item flags.

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

Removes several ItemFlags from the item flags.

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

Sets the lore (description) of the item.

inline fun ItemMeta.setLore(builder: ItemMetaLoreBuilder.() -> Unit)
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)
@JvmName(name = "simpleSetMeta")
inline fun ItemStack.setMeta(builder: ItemMeta.() -> Unit)

Properties

customModel
Link copied to clipboard

Provides safe access to the items' customModelData.

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

Provides more consistent access to the items' localizedName.

var ItemMeta.localName: String
name
Link copied to clipboard

Provides safe access to the items' displayName.

var ItemMeta.name: String?