Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/enchant

Command

/enchant

Adds an enchantment to the item that each target is holding in its main hand.

Syntax

/enchant <targets> <enchantment> [<level>]

Arguments

ArgumentKind of valueWhat to type
<targets>Target selectorThe players or mobs whose main hand item is enchanted. Accepts a player name or a target selector that may match several entities. One or more entities.
<enchantment>Game idThe id of the enchantment to apply, for example minecraft:sharpness. The id of an enchantment.
<level>Whole numberThe enchantment level. Whole number, 0 or higher, and not above the maximum level of the enchantment. Defaults to 1. At least 0.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inOperators on multiplayer servers, singleplayer worlds with cheats enabled, and command blocks and functions.
ResultReports the enchantment and level applied, and who received it. The number /execute store saves is the number of targets whose held item was enchanted.
Level limitThe level cannot be higher than the maximum level of the enchantment (for example 5 for Sharpness, 3 for Unbreaking, 1 for Mending). A higher number fails with a message that names the maximum.
Default levelIf no level is given, level 1 is applied.
Item must support the enchantmentThe held item must be one of the items the enchantment supports. Otherwise the command fails with "cannot support that enchantment".
No conflicting enchantmentsThe command fails if the item already has an enchantment that is exclusive with the new one, or already has the same enchantment. It cannot be used to raise the level of an enchantment the item already has.
Only the main handOnly the item in the main hand is enchanted. A target with an empty hand fails with "is not holding any item".
Targets must be livingTargets must be players or mobs. Other entities, such as dropped items, are not valid.
Several targetsWith more than one target, targets that cannot be enchanted are skipped without an error. If none could be enchanted, the command fails with "Nothing changed".

Examples

/enchant @s minecraft:sharpness 5

Adds Sharpness V to the item in your main hand.

/enchant @s minecraft:mending

Adds Mending to the item in your main hand.

/enchant @s minecraft:unbreaking 3

Adds Unbreaking III to the item in your main hand.

/enchant @p minecraft:efficiency 5

Adds Efficiency V to the tool the nearest player is holding.

/enchant @a minecraft:protection 4

Adds Protection IV to the armor piece each player is holding, and skips players holding something else.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)