KItemImpl

abstract class KItemImpl(var draggingMode: DraggingMode, val material: Material, amount: Int) : ItemStack, KItem

Example implementation of the KItem interface

See also

Inheritors

Constructors

Link copied to clipboard
constructor(draggingMode: DraggingMode, material: Material, amount: Int)

Properties

Link copied to clipboard
open override var draggingMode: DraggingMode

Determines the behaviour of the item when being dragged around the inventory

Link copied to clipboard
val material: Material

of the item

Link copied to clipboard
open override var parent: AbstractContentContainer?

The parent inventory, the item is inside of

Link copied to clipboard
open override var slot: Int

Slot of the item in the parent inventory, if the parent inventory is set

Functions

Link copied to clipboard
@NotNull
open fun add(): @NotNull ItemStack
@NotNull
open fun add(p0: Int): @NotNull ItemStack
Link copied to clipboard
open fun addEnchantment(@NotNull p0: @NotNull Enchantment, p1: Int)
Link copied to clipboard
open fun addEnchantments(@NotNull p0: @NotNull MutableMap<Enchantment, Int>)
Link copied to clipboard
open fun addItemFlags(@NotNull vararg p0: @NotNull ItemFlag)
Link copied to clipboard
open fun addUnsafeEnchantment(@NotNull p0: @NotNull Enchantment, p1: Int)
Link copied to clipboard
open fun addUnsafeEnchantments(@NotNull p0: @NotNull MutableMap<Enchantment, Int>)
Link copied to clipboard
@NotNull
open fun asHoverEvent(): @NotNull HoverEvent<HoverEvent.ShowItem>
@NotNull
open override fun asHoverEvent(@NotNull p0: @NotNull UnaryOperator<HoverEvent.ShowItem>): @NotNull HoverEvent<HoverEvent.ShowItem>
Link copied to clipboard
@NotNull
open fun asOne(): @NotNull ItemStack
Link copied to clipboard
@NotNull
open fun asQuantity(p0: Int): @NotNull ItemStack
Link copied to clipboard
open fun canRepair(@NotNull p0: @NotNull ItemStack): Boolean
Link copied to clipboard
@NotNull
open override fun clone(): @NotNull ItemStack
Link copied to clipboard
open fun computeTooltipLines(@NotNull p0: @NotNull TooltipContext, @Nullable p1: @Nullable Player?): @NotNull @Unmodifiable MutableList<Component>
Link copied to clipboard
open fun containsEnchantment(@NotNull p0: @NotNull Enchantment): Boolean
Link copied to clipboard
@NotNull
open fun damage(p0: Int, @NotNull p1: @NotNull LivingEntity): @NotNull ItemStack
Link copied to clipboard
open fun displayName(): @NotNull Component
Link copied to clipboard
open override fun draggable(): Boolean
Link copied to clipboard
open fun editMeta(@NotNull p0: @NotNull Consumer<in ItemMeta>): Boolean
open fun <M : ItemMeta> editMeta(@NotNull p0: @NotNull Class<M>, @NotNull p1: @NotNull Consumer<in M>): Boolean
Link copied to clipboard
open override fun enchant(enchantment: Enchantment, level: Int)

Enchants this item with the given parameters

Link copied to clipboard
@NotNull
open fun enchantWithLevels(p0: Int, p1: Boolean, @NotNull p2: @NotNull Random): @NotNull ItemStack
Link copied to clipboard
@NotNull
open fun ensureServerConversions(): @NotNull ItemStack
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun getAmount(): Int
Link copied to clipboard
@Nullable
open fun getData(): @Nullable MaterialData?
Link copied to clipboard
open fun getDurability(): Short
Link copied to clipboard
open fun getEnchantmentLevel(@NotNull p0: @NotNull Enchantment): Int
Link copied to clipboard
@NotNull
open fun getEnchantments(): @NotNull MutableMap<Enchantment, Int>
Link copied to clipboard
@Nullable
open fun getI18NDisplayName(): @Nullable String?
Link copied to clipboard
@NotNull
open fun getItemFlags(): @NotNull MutableSet<ItemFlag>
Link copied to clipboard
@UndefinedNullability
open fun getItemMeta(): ItemMeta
Link copied to clipboard
@Nullable
open fun getLore(): @Nullable MutableList<String>?
Link copied to clipboard
open fun getMaxItemUseDuration(@NotNull p0: @NotNull LivingEntity): Int
Link copied to clipboard
open fun getMaxStackSize(): Int
Link copied to clipboard
open override fun getPersistentDataContainer(): @NotNull PersistentDataContainerView
Link copied to clipboard
@NotNull
open fun getRarity(): @NotNull ItemRarity
Link copied to clipboard
@NotNull
open override fun getTranslationKey(): @NotNull String
Link copied to clipboard
@NotNull
open fun getType(): @NotNull Material
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open fun hasItemFlag(@NotNull p0: @NotNull ItemFlag): Boolean
Link copied to clipboard
open fun hasItemMeta(): Boolean
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open fun isRepairableBy(@NotNull p0: @NotNull ItemStack): Boolean
Link copied to clipboard
open fun isSimilar(@Nullable p0: @Nullable ItemStack?): Boolean
Link copied to clipboard
@Nullable
open fun lore(): @Nullable MutableList<Component>?
open fun lore(@Nullable p0: @Nullable MutableList<out Component>?)
Link copied to clipboard
open fun removeEnchantment(@NotNull p0: @NotNull Enchantment): Int
Link copied to clipboard
Link copied to clipboard
open fun removeItemFlags(@NotNull vararg p0: @NotNull ItemFlag)
Link copied to clipboard
@NotNull
open override fun serialize(): @NotNull MutableMap<String, Any>
Link copied to clipboard
@NotNull
open fun serializeAsBytes(): ByteArray
Link copied to clipboard
open fun setAmount(p0: Int)
Link copied to clipboard
open fun setData(@Nullable p0: @Nullable MaterialData?)
Link copied to clipboard
open override fun setDisplayName(name: Component)

Sets the display name of the item

Link copied to clipboard
open fun setDurability(p0: Short)
Link copied to clipboard
open override fun setItemLore(lore: List<Component>)

Sets the lore of the item

Link copied to clipboard
open fun setItemMeta(@Nullable p0: @Nullable ItemMeta?): Boolean
Link copied to clipboard
open fun setLore(@Nullable p0: @Nullable MutableList<String>?)
Link copied to clipboard
open fun setType(@NotNull p0: @NotNull Material)
Link copied to clipboard
@NotNull
open fun subtract(): @NotNull ItemStack
@NotNull
open fun subtract(p0: Int): @NotNull ItemStack
Link copied to clipboard
open override fun toItemStack(): ItemStack

Transforms the KItem to a Bukkit ItemStack

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
@NotNull
open override fun translationKey(): @NotNull String
Link copied to clipboard
@NotNull
@Contract(value = "_ -> new", pure = true)
open fun withType(@NotNull p0: @NotNull Material): @NotNull ItemStack