/enchant with any invalid ID displays message "There is no such enchantment with ID 0"
After you've entered for example
/enchant @p 12345
the message you'll receive does not display the invalid ID that you've actually entered. The message will always say "There is no such enchantment with ID 0", and enchantment ID 0 does by the way exist. Same thing goes for invalid text IDs.
Code analysis by Marcono1234 can be found in this comment.
Linked Issues
Created Issue:
Enchanting with any invalid ID always displays the message "There is no such enchantment with ID 0"
The message you get when you you enter the command
/enchant <player> <(invalid)enchantment id> [level], you will always get the message "There is no such enchantment with ID 0", even if you didn't enter enchantment ID 0.
The message you get when you you enter the command
/enchant <player> <(invalid)enchantment id> [level], you will always get the message "There is no such enchantment with ID 0", even if you didn't enter enchantment ID 0.
The message you get when you you enter the command "/enchant <player> <(invalid)enchantment id> [level]", you will always get the message "There is no such enchantment with ID 0", even if you didn't enter enchantment ID 0.
The message you get when you you enter the command "/enchant <player> <(invalid)enchantment id> [level] ", you will always get the message "There is no such enchantment with ID 0", even if you didn't enter enchantment ID 0.
The message you get when you enter the command
/enchant <player> <(invalid)enchantment id> [level]will always be "There is no such enchantment with ID 0", even if you didn't enter the existing enchantment ID 0.
The message you get whenyou enter the command/enchant <player> <(invalid)enchantment id> [level]will always be "There is no such enchantment with ID 0", even if you didn't enter the existing enchantment ID 0.
If you enter the command
/enchant <player> <enchantment id> [level]with an invalid ID at <enchantment id>, the message you get back will always be "There is no such enchantment with ID 0", even if you didn't enter the existing enchantment ID 0.
If you enter the command
/enchant <player> <enchantment id>[level]with an invalid ID at <enchantment id>, the message you get back will always be "There is no such enchantment with ID 0", even if you didn't enter the existing enchantment ID 0.
If you enter the command
/enchant <player> <enchantment id>with an invalid
ID at <enchantmentid>, the message you get back will always be "There is no such enchantment with ID 0", even if you didn't enter the existing enchantment ID 0.If you enter the command
/enchant <player> <enchantment id>with an invalid enchantment ID, the message you get back will always be "There is no such enchantment with ID 0", even if you didn't enter the existing enchantment ID 0.
SnipUndercover: Can you explain why?
Ifyou enter the command/enchant <player> <enchantment id>with an invalid enchantment ID, the message you
get backwill alwaysbe"There is no such enchantment with ID 0",even if you didn't enter the existing enchantment ID 0.After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, the message you'll receive does not display the invalid ID you've actually entered. It will always display "There is no such enchantment with ID 0", and ID 0 does in fact exist.
After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, the message you'll receive does not display the invalid ID you've actually entered. It will always display "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.
After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, the message you'll receive does not display the invalid ID you've actually entered.
Itwill always display "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, the message you'll receive does not display the invalid ID that you've actually entered. The message will always display "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.
After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, whether the ID was entered in a number or text, the message you'll receive does not display the invalid ID that you've actually entered. The message will always display "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.
After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, whether the ID
was entered in a number or text, the message you'll receive does not display the invalid ID that you've actually entered. The message will always display "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, whether the ID is entered in a number or text, the message you'll receive does not display the invalid ID that you've actually entered. The message will always display "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.
After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, whether the ID is entered in a number or text, the message you'll receive does not display the invalid ID that you've actually entered. The message will always
display "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.After you've entered the command
/enchant <player> <enchantment id>with an invalid enchantment ID, whether the ID is entered in a number or text, the message you'll receive does not display the invalid ID that you've actually entered. The message will always say "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.
relates to
After you've entered
the command/enchant<player> <enchantment id>
with an invalid enchantment ID, whether the ID is entered in a number or text,the message you'll receive does not display the invalid ID that you've actually entered. The message will always say "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist.After you've entered for example
/enchant @p 12345the message you'll receive does not display the invalid ID that you've actually entered. The message will always say "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist. Same thing goes for invalid text IDs.
Enchantingwith any invalid IDalwaysdisplays the message "There is no such enchantment with ID 0"/enchant with any invalid ID displays the message "There is no such enchantment with ID 0"
/enchant with any invalid ID displaysthemessage "There is no such enchantment with ID 0"
A comment with security level 'global-moderators' was removed.
After you've entered for example
/enchant @p 12345the message you'll receive does not display the invalid ID that you've actually entered. The message will always say "There is no such enchantment with ID 0", and enchantment ID 0 does in fact exist. Same thing goes for invalid text IDs.
Code analysis by Marcono1234 can be found in this comment.
After you've entered for example
/enchant @p 12345the message you'll receive does not display the invalid ID that you've actually entered. The message will always say "There is no such enchantment with ID 0", and enchantment ID 0 does
in factexist. Same thing goes for invalid text IDs.
Code analysis by Marcono1234 can be found in this comment.
After you've entered for example
/enchant @p 12345the message you'll receive does not display the invalid ID that you've actually entered. The message will always say "There is no such enchantment with ID 0", and enchantment ID 0 does by the way exist. Same thing goes for invalid text IDs.
Code analysis by Marcono1234 can be found in this comment.

its not a bug
Michael, it must be "There is no such enchantment with ID 12345" or so
oops, didn't saw the 0 on the end
Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The reason why this happens is because the method net.minecraft.command.CommandEnchant.execute(MinecraftServer, ICommandSender, String[]) first tries to read an enchantment number id. If this fails it tries to read an echantment string id. The returned enchantment is null if no matching enchantment was found. The problem is that if the enchantment is null it throws a NumberInvalidException with the returned enchantment, which is null and results in an ID of 0. Instead it should just print the given enchantment id String from the command.