Builder

interface Builder<B : BookMeta.Builder<B, I>, I : BookMeta<B, I>> : ItemMetaBuilder<B, I>

A builder for building book metadata.

Inheritors

Functions

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun addAttributeModifier(modifier: ItemAttributeModifier): B

Adds the given modifier modifier to the list of attribute modifiers for the item.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun addCanDestroy(block: Block): B

Adds the given block to the list of blocks the item can destroy.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun addCanPlaceOn(block: Block): B

Adds the given block to the list of blocks the item can be placed on.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun addFlag(flag: ItemFlag): B

Sets the given hide flag on the item.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun addLore(lore: Component): B

Adds the given lore line to the lore of the item.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun addPage(page: Component): B

Adds the given page to the list of pages the book has.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
open fun attributeModifiers(vararg modifiers: ItemAttributeModifier): B
@Contract(value = "_ -> this", mutates = "this")
abstract fun attributeModifiers(modifiers: Collection<ItemAttributeModifier>): B

Sets the list of attribute modifiers applied to entities wearing items that the metadata is applied to to the given modifiers.

Link copied to clipboard
@Contract(value = "-> new", pure = true)
abstract fun build(): I

Builds the resulting item metadata.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
open fun canDestroy(vararg blocks: Block): B
@Contract(value = "_ -> this", mutates = "this")
abstract fun canDestroy(blocks: Collection<Block>): B

Sets the list of blocks the item can destroy to the given blocks.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
open fun canPlaceOn(vararg blocks: Block): B
@Contract(value = "_ -> this", mutates = "this")
abstract fun canPlaceOn(blocks: Collection<Block>): B

Sets the list of blocks the item can be placed on to the given blocks.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun customModelData(data: Int): B

Sets the custom model data for the item to the given data.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun damage(damage: Int): B

Sets the damage of the item to the given damage.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun hideFlags(flags: Int): B

Sets the hide flags for the item to the given flags.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
open fun lore(vararg lore: Component): B
@Contract(value = "_ -> this", mutates = "this")
abstract fun lore(lore: Collection<Component>): B

Sets the lore of the item to the given lore.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun name(name: Component?): B

Sets the name of the item to the given name.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
open fun pages(vararg pages: Component): B
@Contract(value = "_ -> this", mutates = "this")
abstract fun pages(pages: Collection<Component>): B

Sets the pages the book has to the given pages.

Link copied to clipboard
@Contract(value = "-> this", mutates = "this")
open fun unbreakable(): B

Makes the item unbreakable.

@Contract(value = "_ -> this", mutates = "this")
abstract fun unbreakable(value: Boolean): B

Sets whether the item is unbreakable to the given value.