Skip to content

@minecraft/server


@minecraft/server / EnchantmentTypes

Class: EnchantmentTypes ​

Defined in: @minecraft/server/index.d.ts:8354

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

Methods ​

get() ​

static get(enchantmentId): EnchantmentType | undefined

Defined in: @minecraft/server/index.d.ts:8367

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.

Remarks ​

Retrieves an enchantment with the specified identifier.


getAll() ​

static getAll(): EnchantmentType[]

Defined in: @minecraft/server/index.d.ts:8373

Returns ​

EnchantmentType[]

Remarks ​

Returns a collection of all available enchantment types.