
Command
/enchant
Adds an enchantment to the item that each target is holding in its main hand.
| /enchant <targets> <enchantment> [<level>] |
| Argument | Kind of value | What to type |
|---|---|---|
| <targets> | Target selector | The 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 id | The id of the enchantment to apply, for example minecraft:sharpness. The id of an enchantment. |
| <level> | Whole number | The enchantment level. Whole number, 0 or higher, and not above the maximum level of the enchantment. Defaults to 1. At least 0. |
| Permission level | 2: operators, worlds with cheats on, command blocks and functions |
| Works in | Operators on multiplayer servers, singleplayer worlds with cheats enabled, and command blocks and functions. |
| Result | Reports 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 limit | The 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 level | If no level is given, level 1 is applied. |
| Item must support the enchantment | The held item must be one of the items the enchantment supports. Otherwise the command fails with "cannot support that enchantment". |
| No conflicting enchantments | The 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 hand | Only the item in the main hand is enchanted. A target with an empty hand fails with "is not holding any item". |
| Targets must be living | Targets must be players or mobs. Other entities, such as dropped items, are not valid. |
| Several targets | With 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". |
/enchant @s minecraft:sharpness 5Adds Sharpness V to the item in your main hand.
/enchant @s minecraft:mendingAdds Mending to the item in your main hand.
/enchant @s minecraft:unbreaking 3Adds Unbreaking III to the item in your main hand.
/enchant @p minecraft:efficiency 5Adds Efficiency V to the tool the nearest player is holding.
/enchant @a minecraft:protection 4Adds Protection IV to the armor piece each player is holding, and skips players holding something else.



