EnchantmentTypes Class

Caution

This class is still in pre-release. Its signature may change or it may be removed in future releases.

Contains a catalog of Minecraft Enchantment Types that are available in this world.

Methods

get

static "get"(enchantmentId: string): EnchantmentType | undefined

Retrieves an enchantment with the specified identifier.

Parameters

  • enchantmentId: string

    Identifier of the enchantment. For example, "minecraft:flame".

Returns EnchantmentType | undefined - If available, returns an EnchantmentType object that represents the specified enchantment.

getAll

static getAll(): EnchantmentType[]

Returns a collection of all available enchantment types.

Returns EnchantmentType[]