Builder

A builder for building compass metadata.

Functions

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

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): CompassMeta.Builder

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): CompassMeta.Builder

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): CompassMeta.Builder

Sets the given hide flag on the item.

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

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

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

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(): CompassMeta

Builds the resulting item metadata.

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

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): CompassMeta.Builder
@Contract(value = "_ -> this", mutates = "this")
abstract fun canPlaceOn(blocks: Collection<Block>): CompassMeta.Builder

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): CompassMeta.Builder

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): CompassMeta.Builder

Sets the damage of the item to the given damage.

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

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

Link copied to clipboard
@Contract(value = "_, _ -> this", mutates = "this")
abstract fun lodestone(dimension: ResourceKey<World>, position: Vec3i): CompassMeta.Builder

Sets the dimension and position of the lodestone the compass is tracking to the given dimension and position.

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

Sets the lore of the item to the given lore.

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

Sets the name of the item to the given name.

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

Makes the item unbreakable.

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

Sets whether the item is unbreakable to the given value.