Enchant Command Generator — /enchant a Held Item (Java Edition)
Run these from an operator’s chat, a command block, or the server console. Rotate, Swing and Display Entity use newer command/entity features — check they’re available on your Minecraft version.
How to Use the Enchant Command Generator
- Enter a target selector, defaulting to
@p. The target needs an item in its main hand for the command to have anything to enchant. - Pick an enchantment from the dropdown, such as
minecraft:sharpnessorminecraft:mending. - Set the level – this is written directly into the command with no conversion (unlike the Effect tool’s amplifier offset).
- Copy the generated
/enchantcommand into a command block, the console, or an operator’s chat.
Command Syntax Reference
/enchant <target> <enchantment> [level]
/enchant applies an enchantment directly to whatever item the target is currently holding in its main hand – it does not create a new item or affect the offhand or armor slots. If the level argument is omitted, the game defaults to level 1. This tool always writes the level explicitly.
Unlike a real enchanting table or anvil, the command doesn’t check normal restrictions: it will happily apply an enchantment to an item that couldn’t normally receive it (for example, forcing Sharpness onto a pickaxe), and it accepts levels beyond an enchantment’s usual vanilla maximum (Sharpness normally caps at V, but the command will accept a much higher number, though the actual effect the game applies at excessive levels can vary or be clamped internally depending on version). It also fails outright – with no visible item change – if the target isn’t holding an item, or if the enchantment is fundamentally incompatible with the item’s enchantability in a way the game hard-blocks.
Frequently Asked Questions
Does /enchant respect conflicting enchantments, like Sharpness and Silk Touch?
The command generally allows combinations that a survival enchanting table or anvil would normally block, since it skips the usual compatibility checks – you can end up with an item carrying enchantments that could never legitimately coexist through normal gameplay. This is one of the main reasons players reach for the command instead of an anvil: to test or showcase otherwise-impossible combinations.
Can /enchant put an enchantment on the wrong item type, like Frost Walker on a sword?
Yes, in most versions the command doesn’t enforce an enchantment’s normal item-category restriction the way a survival enchanting table or anvil does – you can force an armor enchantment onto a weapon, for instance. The enchantment’s actual effect may then simply not trigger, since the game engine checks the wearer/holder context (an armor enchantment on a sword still won’t do anything, because it only activates from an armor slot), but the command itself won’t refuse to attach it.
What happens if I set a level higher than the enchantment’s real max, like Sharpness 10?
The command accepts it, and the enchantment is stored at that level – some enchantments show visibly stronger effects scaled past their normal cap, while others may be internally treated the same as their vanilla maximum depending on how the effect’s math is implemented. Results vary by enchantment and version, so testing the specific one you want is the reliable way to know.
Does /enchant work on items in the offhand or armor slots?
No – it only affects whatever is in the target’s main hand at the moment the command runs. To enchant an offhand or armor item, the target needs to be holding that item in the main hand first (swap it there, run the command, then move it back), or the enchantment needs to be applied a different way, such as through NBT on a summoned or given item.
Related Tools
- Attribute Command Generator – adjust base combat stats directly instead of through item enchantments.
- Summon Command Generator – spawn an entity to hand an enchanted item to.
- Effect Command Generator – apply a temporary status effect instead of a permanent item enchantment.