Uploaded image for project: 'Minecraft'
  1. Minecraft
  2. MC-99763

help command not suggesting tab completion when executed from other entity

    Details

    • Confirmation Status:
      Confirmed

      Description

      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

      1. Run the following command
        /help
        

        You will see the TAB completion hint

      2. Place an ArmorStand
      3. 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);
              }
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Excited [Mojang] Maria Lemón
              Reporter:
              marcono1234 [Helper] Marcono1234
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: