mojira.dev
MC-99748

scoreboard teams join and leave not showing error message for missing player argument in command blocks

The bug

Commands like /kill or /gamemode 1 will print an error message in command blocks saying that a player needs to be specified. However, this is not the case for /scoreboard teams join team and /scoreboard teams leave

How to reproduce

  1. Add a team

    /scoreboard teams add testTeam
  2. Place a command block and enter the following command

    /scoreboard teams join testTeam
  3. Power the command block

Instead of the error message "You must specify ..." it will print the syntax help.

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 reason why this happens is because the method net.minecraft.command.server.CommandScoreboard.execute(MinecraftServer, ICommandSender, String[]) tests if the sender is a player which it should not do. Instead the method net.minecraft.command.CommandBase.getCommandSenderAsPlayer(ICommandSender) should be called which would then throw the exception.

Linked issues

Comments 1

Fixed in some 1.13 snapshot.

marcono1234

(Unassigned)

Confirmed

command, command-feedback, error-message, player, scoreboard, scoreboard-teams, teams

Minecraft 1.9.1 Pre-Release 3, Minecraft 16w33a, Minecraft 16w42a, Minecraft 1.12.2

Minecraft 18w03b

Retrieved