RequiredEnchantment

@Since(version = "2.2")
data class RequiredEnchantment(val enchantmentKey: NamespacedKey, val seekers: List<RegistrableEnchantmentSeeker>, val levels: List<Int>) : Keyed, Describable<RequiredEnchantment>

This object represents an enchantment being required as a part of another enchantment. For example, an enchantment might require the player to have Fire Aspect of any level on the same item, or Sharpness from II to V on the offhand item.

Constructors

Link copied to clipboard
constructor(enchantmentKey: NamespacedKey, seekers: List<RegistrableEnchantmentSeeker>, levels: List<Int>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val enchantmentKey: NamespacedKey
Link copied to clipboard

Returns all levels that are accepted. If the list is empty, it is assumed that any level is accepted.

Link copied to clipboard

Returns all seekers for this enchantment. Out of all of them, at least one of them must find the enchantment. If the list is empty, the enchantment is assumed to be sought on the same item that has activated the enchantment - however, since there is no clear way to determine exactly what item activated the enchantment (the initial seeker might find multiple matching items during the activation detection process), this is discouraged.

Functions

Link copied to clipboard

Gets the describer for the object.

Link copied to clipboard
open override fun getKey(): NamespacedKey