An enchantment by its id, as minecraft:sharpness.
Class in @minecraft/server
An enchantment by its id, as minecraft:sharpness.
import { EnchantmentType } from '@minecraft/server';Constructor
Section titled “Constructor”constructor(enchantmentType: string);Parameters
enchantmentTypestring
Throws
- TypeError for an enchantment that doesn’t exist.
Properties
Section titled “Properties”read-only
readonly id: string;maxLevel
Section titled “maxLevel”read-only
readonly maxLevel: number;The highest level it goes to.
Used by
Section titled “Used by”Enchantment.type, ItemEnchantableComponent.getEnchantment, ItemEnchantableComponent.getEnchantments, ItemEnchantableComponent.hasEnchantment, ItemEnchantableComponent.removeEnchantment