Mojira Archive
MC-106677

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

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.

Invalid

Marcono1234

2016-08-31, 03:49 PM

2018-01-30, 01:24 AM

2018-01-30, 01:24 AM

1

3

Confirmed

AffectedEntities, command, scoreboard, stats

Minecraft 1.10.2, Minecraft 16w33a, Minecraft 1.12.2

-