Sharpness V on your weapon
/enchant @s minecraft:sharpness 5Adds Sharpness V to the sword or axe in your main hand.

/enchant adds an enchantment to the item that a player or a mob holds in its main hand. It follows survival rules: the item must accept the enchantment, the level cannot go past the normal maximum, and enchantments that conflict with the existing ones are refused.
/enchant <targets> <enchantment> [<level>]| Argument | Expects | What it does |
|---|---|---|
| targets | Entity selectorone or several | Entities whose main hand item is enchanted: @s, @p, @a, or a mob such as @e[type=minecraft:zombie,limit=1]. |
| enchantment | ID · enchantment | Enchantment ID, for example minecraft:sharpness or minecraft:mending. The list on this page gives every ID. |
| leveloptional | Whole numberat least 0 | Enchantment level, 1 by default. It cannot exceed the normal maximum of the enchantment. |
/enchant @s minecraft:sharpness 5Adds Sharpness V to the sword or axe in your main hand.
/enchant @s minecraft:mendingWithout a level, the enchantment is applied at level I, the only level of Mending.
/enchant @a minecraft:unbreaking 3Each player gets Unbreaking III on the held item, if it accepts it.
/enchant @e[type=minecraft:zombie,limit=1,sort=nearest] minecraft:fire_aspect 2If the nearest zombie holds a sword, it gets Fire Aspect II.
Fill in the fields, copy the command, paste it in the chat. Syntax checked against Java Edition 26.3.
Turn on JavaScript to use the interactive version.
/enchant @p sharpness 5Calculated from the Java Edition 26.3 game files
aqua_affinitybane_of_arthropodsblast_protectionbreachchannelingbinding_cursevanishing_cursedensitydepth_striderefficiencyfeather_fallingfire_aspectfire_protectionflamefortunefrost_walkerimpalinginfinityknockbacklootingloyaltyluck_of_the_sealungeluremendingmultishotpiercingpowerprojectile_protectionprotectionpunchquick_chargerespirationriptidesharpnesssilk_touchsmitesoul_speedsweeping_edgeswift_sneakthornsunbreakingwind_burstThe command only reads the main hand. Three messages explain most failures:
6 is higher than the maximum level of 5 supported by that enchantment: the level is above the enchantment's maximum.Diamond Pickaxe cannot support that enchantment: the item does not accept it, or it conflicts with an enchantment already there, such as Sharpness with Smite, or Silk Touch with Fortune.Steve is not holding any item: the main hand is empty.For Sharpness 10 or for conflicting enchantments on one item, use /give with the enchantments component: /give @s minecraft:diamond_sword[enchantments={sharpness:10}]. An Enchanted Book uses the stored_enchantments component instead. To change an item in another slot, apply an item modifier with /item.
Mobs holding a weapon can be enchanted too, which makes custom bosses easy. To pick the right enchantments for a weapon, see the best sword enchantments.
✓ Checked in Java Edition 26.3 · updated 2 November 2026
Either the item type cannot take it, for example Sharpness on a pickaxe, or it conflicts with an enchantment already on the item. Use /give with the enchantments component to bypass both rules.
Not with /enchant, which only reads the main hand. For another slot, use /item modify with an item modifier such as set_enchantments.
Type it in the chat with cheats on: /enchant <targets> <enchantment> [<level>].
Cheats on, or operator level 2.