Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-106677

AffectedEntities stats score is always set to 1 for every command without player index

XMLWordPrintable

    • Confirmed

      The bug

      The command stat AffectedEntities is always set to 1 when a command without a player index is executed.

      How to reproduce

      1. :
        /scoreboard objectives add stats dummy
        
      2. :
        scoreboard players set affectedEntities stats 0
        
      3. :
        /scoreboard objectives setdisplay sidebar stats
        
      4. Run in command block:
        /setblock ~ ~1 ~ command_block default replace {Command:"/say Test",CommandStats:{AffectedEntitiesName:"affectedEntities",AffectedEntitiesObjective:"stats"}}
        
      5. Activate the new command block
        → The score of "affectedEntities" is now 1

      The reason

      The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

      The reason for this is that the method net.minecraft.command.CommandHandler.executeCommand(ICommandSender, String) sets the affected entities stat to 1 if the command contains no player index.

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: