CrossbowMeta

Item metadata for a crossbow.

Types

Link copied to clipboard

A builder for building crossbow metadata.

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun hasFlag(flag: ItemFlag): Boolean

Checks whether the item has the given item flag.

Link copied to clipboard
@Contract(value = "-> new", pure = true)
abstract fun toBuilder(): CrossbowMeta.Builder

Converts this object to a builder with all of the properties of this object set by default.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
open fun with(builder: Consumer<CrossbowMeta.Builder>): CrossbowMeta

Creates new item metadata from the result of applying the given builder.

@Contract(value = "_ -> new", pure = true)
open fun with(builder: CrossbowMeta.Builder.() -> Unit): CrossbowMeta

Creates new item metadata from the result of applying the given builder.

Link copied to clipboard
abstract override fun withAttributeModifier(modifier: ItemAttributeModifier): CrossbowMeta

Creates new item metadata with the given modifier added to the list of modifiers for this item.

Link copied to clipboard

Creates new item metadata with the given attribute modifiers.

Link copied to clipboard
abstract override fun withCanDestroy(blocks: Collection<Block>): CrossbowMeta

Creates new item metadata with the given can destroy blocks.

Link copied to clipboard
abstract override fun withCanPlaceOn(blocks: Collection<Block>): CrossbowMeta

Creates new item metadata with the given can destroy blocks.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
abstract fun withCharged(charged: Boolean): CrossbowMeta

Creates new item metadata with the given charged setting.

Link copied to clipboard
abstract override fun withCustomModelData(data: Int): CrossbowMeta

Creates new item metadata with the given custom model data.

Link copied to clipboard
abstract override fun withDamage(damage: Int): CrossbowMeta

Creates new item metadata with the given damage.

Link copied to clipboard
abstract override fun withHideFlag(flag: ItemFlag): CrossbowMeta

Creates new item metadata with the given hide flag set.

Link copied to clipboard
abstract override fun withHideFlags(flags: Int): CrossbowMeta

Creates new item metadata with the given hide flags.

Link copied to clipboard
abstract override fun withLore(lore: List<Component>): CrossbowMeta

Creates new item metadata with the given lore.

abstract override fun withLore(lore: Component): CrossbowMeta

Creates new item metadata with the given lore line added to the bottom of the lore text.

Link copied to clipboard
abstract override fun withName(name: Component?): CrossbowMeta

Creates new item metadata with the given name.

Link copied to clipboard

Creates new item metadata with the given modifier removed from the list of modifiers for this item.

Link copied to clipboard
abstract override fun withoutAttributeModifiers(): CrossbowMeta

Creates new item metadata without any modifiers.

Link copied to clipboard
abstract override fun withoutHideFlag(flag: ItemFlag): CrossbowMeta

Creates new item metadata without the given hide flag set.

Link copied to clipboard
abstract override fun withoutLore(index: Int): CrossbowMeta

Creates new item metadata with the lore line at the given index removed from the lore.

abstract override fun withoutLore(lore: Component): CrossbowMeta

Creates new item metadata with the given lore line removed from the lore.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
abstract fun withoutProjectile(index: Int): CrossbowMeta

Creates new item metadata with the projectile at the given index removed from the projectiles list.

@Contract(value = "_ -> new", pure = true)
abstract fun withoutProjectile(projectile: ItemStack): CrossbowMeta

Creates new item metadata with the given projectile removed from the projectiles list.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
abstract fun withProjectile(projectile: ItemStack): CrossbowMeta

Creates new item metadata with the given projectile added to the end of the projectiles list.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
abstract fun withProjectiles(projectiles: List<ItemStack>): CrossbowMeta

Creates new item metadata with the given projectiles.

Link copied to clipboard
abstract override fun withUnbreakable(unbreakable: Boolean): CrossbowMeta

Creates new item metadata with the given unbreakable setting.

Properties

Link copied to clipboard
@get:JvmName(name = "attributeModifiers")
abstract val attributeModifiers: @Unmodifiable List<ItemAttributeModifier>

All of the attribute modifiers that will be applied to entities holding items with this metadata.

Link copied to clipboard
@get:JvmName(name = "canDestroy")
abstract val canDestroy: @Unmodifiable Set<Block>

All of the blocks that the item can destroy.

Link copied to clipboard
@get:JvmName(name = "canPlaceOn")
abstract val canPlaceOn: @Unmodifiable Set<Block>

All of the blocks that the item can be placed on.

Link copied to clipboard
@get:JvmName(name = "customModelData")
abstract val customModelData: Int

The custom model data for the item.

Link copied to clipboard
@get:JvmName(name = "damage")
abstract val damage: Int

The current damage on the item.

Link copied to clipboard
@get:JvmName(name = "hideFlags")
abstract val hideFlags: Int

The flags that determine what is hidden for the item.

Link copied to clipboard
abstract val isCharged: Boolean

If the crossbow is charged.

Link copied to clipboard
abstract val isUnbreakable: Boolean

If the item cannot be broken.

Link copied to clipboard
@get:JvmName(name = "lore")
abstract val lore: @Unmodifiable List<Component>

The lore of the item.

Link copied to clipboard
@get:JvmName(name = "name")
abstract val name: Component?

The display name of the item.

Link copied to clipboard
@get:JvmName(name = "projectiles")
abstract val projectiles: @Unmodifiable List<ItemStack>

The projectiles that the crossbow has charged.