mojira.dev
MC-261942

Anvils allow you to enchant anything, but the /enchant command doesn't

You can't /enchant something that can't normally be enchanted in survival mode, like putting Knockback on an axe, which is kind of silly to not allow being that it is a weapon, but you can use an anvil to put Knockback on anything, including literally a grass block, without even using cheats.

Steps to reproduce

  1. Get a netherite axe and hold it

  2. run /enchant @s knockback 2

❌ the command fails

3. Get a Knockback II enchanted book

Try to combine the book with the axe.

Notice The anvil allows it (and that the enchantment functions as it would with any other tool).

Linked issues

Comments 4

This is a change request, and not actually a bug. /enchant is intentionally limited to survival-applicable enchantments (and has worked that way since addition). Anvils only bypass this in creative mode.

For feature/change requests, go to the feedback site.

/enchant was added before enchanted books were and the command uses the wording "[item] does not support..." suggests that that enchantment would be useless on the item when most items (Knockback for example) works properly on any item, I don't see why they would intentionally limit a cheat command to survival only applications

That's how it has been since addition; that it hasn't been changed in light of newer additions (anvils and enchanted books) is not a bug, but a change request.

I'll leave this open for Mojang to decide, but I personally would expect this to be considered a feature request / WAI / Won't Fix.

Brevort

(Unassigned)

Confirmed

Platform

Low

Commands

1.19.4, 23w18a, 1.20 Release Candidate 1, 1.20, 1.20.1, 1.20.4, 24w14a, 1.21, 25w06a

Retrieved