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
- :
/scoreboard objectives add stats dummy
- :
scoreboard players set affectedEntities stats 0
- :
/scoreboard objectives setdisplay sidebar stats
- Run in command block:
/setblock ~ ~1 ~ command_block default replace {Command:"/say Test",CommandStats:{AffectedEntitiesName:"affectedEntities",AffectedEntitiesObjective:"stats"}}
- 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.
2016-08-31, 03:49 PM
2018-01-30, 01:24 AM
2018-01-30, 01:24 AM
1
3
AffectedEntities, command, scoreboard, stats
Minecraft 1.10.2, Minecraft 16w33a, Minecraft 1.12.2
-