Enchanted items
Create items with any enchantments and levels using /give with NBT data.
Commands
/enchant @s minecraft:sharpness 5 Enchants the item you're holding with Sharpness V
/enchant @s minecraft:efficiency 5 Enchants the item you're holding with Efficiency V
/enchant @s minecraft:unbreaking 3 Enchants the item you're holding with Unbreaking III
/enchant @s minecraft:mending Enchants the item you're holding with Mending
How it works
The /give command with NBT tags (Java Edition) or data components lets you create items with enchantments beyond the game's normal limits. Sharpness normally goes up to level V, but with a command you can give it level 255, which makes a sword that kills practically anything in one hit. Likewise, Efficiency 255 on a pickaxe breaks blocks instantly. In Java Edition 1.20.5 and newer, the syntax changed: instead of the old NBT tags, you use the new data component format. With /give you can also put several enchantments on one item, even ones that normally conflict, such as Sharpness, Smite and Bane of Arthropods on a single sword. In Bedrock Edition you can use the /enchant command, but it doesn't go past the standard limits: for that, you need NBT editing with external tools or behavior packs.
Practical tips
The /enchant command follows the game's normal limits: you can't put Sharpness on a bow.
To go past the limits, use /give with NBT tags (Java) or an NBT editor.
In Bedrock, /enchant is the only built-in way to enchant items with a command.
Mending and Infinity are mutually exclusive on a bow.
Details
Related cheats
Diamonds and resources
/give @s minecraft:diamond 64 Netherite armor and tools
/give @s minecraft:netherite_helmet 1 Special items
/give @s minecraft:enchanted_golden_apple 64 Invincibility (god mode)
/gamemode creative