/enchant Command
Adds an enchantment to the item currently held in the main hand of one or more targets. Respects the same level caps and incompatibility rules as an anvil. Level defaults to 1 if not specified.
Syntax
/enchant <targets> <enchantment> [<level>]Permission: OP level 2Edition: Both
Examples
/enchant @p minecraft:sharpness 5/enchant @a minecraft:protection 4/enchant @s minecraft:mending 1/enchant @p minecraft:fortune 3Notes
Enforces vanilla max levels and enchantment incompatibilities (e.g. Sharpness and Smite cannot coexist). On Java Edition, the command fails entirely if the held item already has the enchantment at any level — use /give with component data to bypass limits. Level 0 is accepted syntactically on Java but effectively removes the enchantment entry. The target must be holding an enchantable item or the command fails.