Files
KSpigot/docs/-k-spigot/net.axay.kspigot.items/index.md
bluefireoly 69b2e6cd17 Updated docs
2020-10-16 02:13:42 +02:00

6.4 KiB

title
title
net.axay.kspigot.items -

//KSpigot/net.axay.kspigot.items

Package net.axay.kspigot.items

Types

Name Summary
CustomItemIdentifier [jvm]
Brief description




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.




Content
data class CustomItemIdentifier(customModelData: Int, placeHolderMaterial: Material)


ItemMetaLoreBuilder [jvm]
Brief description


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


Content
class ItemMetaLoreBuilder


Functions

Name Summary
addLore [jvm]
Brief description


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


Content
inline fun ItemMeta.addLore(builder: ItemMetaLoreBuilder.() -> Unit)


flag [jvm]
Brief description


Add a new ItemFlag to the item flags.


Content
fun ItemMeta.flag(itemFlag: ItemFlag)


flags [jvm]
Brief description


Add several ItemFlags to the item flags.


Content
fun ItemMeta.flags(vararg itemFlag: Array)


itemMeta [jvm]
Brief description


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


Content
inline fun <T : ItemMeta> itemMeta(material: Material, builder: T.() -> Unit): T?


[jvm]
Content
@JvmName(name = "simpleItemMeta")

inline fun itemMeta(material: Material, builder: ItemMeta.() -> Unit): ItemMeta?


itemStack [jvm]
Brief description


Creates a new ItemStack and opens a builder for it.


Content
inline fun itemStack(material: Material, builder: ItemStack.() -> Unit): ItemStack


meta [jvm]
Brief description


Opens a builder with the current meta.


Content
inline fun <T : ItemMeta> ItemStack.meta(builder: T.() -> Unit)


[jvm]
Content
@JvmName(name = "simpleMeta")

inline fun ItemStack.meta(builder: ItemMeta.() -> Unit)


removeFlag [jvm]
Brief description


Removes a ItemFlag from the item flags.


Content
fun ItemMeta.removeFlag(itemFlag: ItemFlag)


removeFlags [jvm]
Brief description


Removes several ItemFlags from the item flags.


Content
fun ItemMeta.removeFlags(vararg itemFlag: Array)


setLore [jvm]
Brief description


Sets the lore (description) of the item.


Content
inline fun ItemMeta.setLore(builder: ItemMetaLoreBuilder.() -> Unit)


setMeta [jvm]
Brief description


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


Content
inline fun <T : ItemMeta> ItemStack.setMeta(builder: T.() -> Unit)


[jvm]
Content
@JvmName(name = "simpleSetMeta")

inline fun ItemStack.setMeta(builder: ItemMeta.() -> Unit)


Properties

Name Summary
customModel [jvm]

Provides safe access to the items' customModelData.

var ItemMeta.customModel: Int?
localName [jvm]

Provides more consistent access to the items' localizedName.

var ItemMeta.localName: String
name [jvm]

Provides safe access to the items' displayName.

var ItemMeta.name: String?