-
Bug
-
Resolution: Fixed
-
Minecraft 1.9.1 Pre-Release 3
-
Confirmed
The bug
Currently (1.9.1-pre3) running the /help command for other entities using the /execute command prints the help message for the player or command block running the /execute command. However, when doing this there is no TAB completion hint.
How to reproduce
- Run the following command
/help
You will see the TAB completion hint
- Place an ArmorStand
- Now execute the /help command from the ArmorStand
/execute @e[type=ArmorStand,c=1] ~ ~ ~ /help
You will see no TAB completion hint
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.CommandHelp.execute(MinecraftServer, ICommandSender, String[]) tests if the sender is a player. As TAB completion now works in command blocks as well, this test should probably be removed.
/** * Callback for when the command is executed * * @param server The Minecraft server instance * @param sender The source of the command invocation * @param args The arguments that were passed */ public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (sender instanceof CommandBlockBaseLogic) { //... } else { //... // Replaced this //if (k == 0 && sender instanceof EntityPlayer) if (k == 0) { TextComponentTranslation textcomponenttranslation2 = new TextComponentTranslation("commands.help.footer", new Object[0]); textcomponenttranslation2.getChatStyle().setColor(TextFormatting.GREEN); sender.addChatMessage(textcomponenttranslation2); } } }