Mojira Archive
MC-78779

commands with optional player argument have missing error translation in command blocks

The bug

When you enter this

/kill

command into a command block, it will give you this error message, regardless what language you selected (because it has no translation)

[15:40:45] You must specify which player you wish to perform this action on.

Affected commands

  • /achievement
  • /clear
  • /gamemode
  • /kill
  • /scoreboard teams (join and leave) (uses the same method but does not print the correct error message in command blocks for some reason)
  • /setworldspawn
  • /spawnpoint
  • /xp

The reason

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The method net.minecraft.command.CommandBase.getCommandSenderAsPlayer(ICommandSender) throws a PlayerNotFoundException with this error message (not a translation) if the sender is not a player.