Updated:

Enchant vs give

The /enchant command changes the item a player is holding. The /give command can create a new item with custom data. If you want custom names, lore and multiple options, the give generator is usually more flexible.

Popular examples

Choose a regular /enchant command if you already hold compatible equipment. Choose a /give command if you need to create a new weapon with several attributes or custom properties; the required format depends on the Minecraft version.

Test a basic enchantment first

/enchant @p minecraft:sharpness 3

For Java Edition, the target must be holding an item compatible with Sharpness. If the player is holding a block or an incompatible item, the command can fail even when the enchantment ID is correct. Standard /enchant also enforces compatibility and level restrictions; it is not a way to bypass survival-enchantment limits.

When to use Give instead of Enchant

If you need a named weapon, several enchantments, or a command-defined item with detailed properties, a custom Give command is more suitable. Use the enchantment generator for its supported workflows, and check which selected version controls the generated item format. Java 1.20.5+ item components use a different representation from older Java NBT.

Check these problems before reporting a bug

  1. Hold the intended sword, axe or tool in the main hand.
  2. Confirm the target selector matches the player holding the item.
  3. Start with a normal allowed level before trying unusual combinations.
  4. Compare Java and Bedrock IDs instead of copying the same custom data into both editions.

Enchanted items with /give, by version

VersionDiamond sword with Sharpness X
Java 1.21.5+/give @p minecraft:diamond_sword[enchantments={sharpness:10}]
Java 1.20.5–1.21.4/give @p minecraft:diamond_sword[enchantments={levels:{sharpness:10}}]
Java 1.13–1.20.4/give @p minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:10s}]}

Java 1.20.5 replaced item NBT with components, and 1.21.5 removed the levels wrapper. Using the wrong format for your version gives an error or an item without enchantments. With /give you can go above the normal maximum level (up to 255) and combine enchantments that normally conflict.

What /enchant cannot do

Bedrock Edition

/enchant @p sharpness 5

Bedrock uses the same order and the minecraft: prefix is optional. Bedrock's /give cannot add enchantments, so give the item first and then use /enchant.

Common enchantment IDs

EnchantmentIDMax level
SharpnesssharpnessV
EfficiencyefficiencyV
UnbreakingunbreakingIII
FortunefortuneIII
MendingmendingI
ProtectionprotectionIV

FAQ

Why does /enchant say the item cannot accept the enchantment?

The held item does not support it (for example Sharpness on a pickaxe), or it already has that enchantment or a conflicting one.

Can I make an unbreakable sword?

Yes, in Java Edition with /give. In 1.20.5 and later add the unbreakable component, for example [unbreakable={}].

Related tools