mojira.dev
MC-125364

The /enchant command can execute successfully at level zero, and will do nothing to the item

The /enchant command can be used to enchant items with a level of 0, when it should only succeed at a level of 1 or more.

Steps to Reproduce:

  1. Hold an un-enchanted tool in your main-hand

  2. Run the following command:

    /enchant @p minecraft:unbreaking 0

Expected Result:

The command would fail — showing a command in chat, and do nothing to the item.

Observed Result:

The command acts as though it succeeded, sending a message in chat. Nothing will happen to the item, and it will remain un-enchanted.

Linked issues

Attachments

Comments 22

The error message when enchanting with an invalid value even says, "Integer must not be less than 0" so if even that explanation is coded that way, could it be (for some useless reason) intended?

Can confirm in 21w03a.

Can confirm in 21w05a.

Can confirm in 21w06a.

Can confirm in 21w07a.

12 more comments

Can confirm in 1.19.2.

Can confirm in 1.20.4.

In 1.20.6 this still acts like it is successful, but the item no longer has the enchant glint or desc. So it is partially fixed.

Can confirm in 1.21 Pre-Release 4, however, the item does not get enchanted.

The command still gives a success message.

Can confirm in 1.21.

[Mod] redstonehelper

(Unassigned)

Confirmed

Commands

/enchant

Minecraft 18w07a, Minecraft 1.13-pre6, Minecraft 18w30b, Minecraft 18w32a, Minecraft 1.13.1-pre2, ..., 1.20.6, 1.21 Pre-Release 4, 1.21, 1.21.1, 1.21.4

Retrieved