mojira.dev
MC-46223

@a doesn't include dead players

Fix note

The @a selector (but only without a radius/area defined via r/rx/ry/rz) will include dead players in the next snapshot. All other selectors work as intended.

EDIT 2 : simple way to reproduce this bug :
1. Create a random scoreboard objectives : /scoreboard objectives add random dummy - /scoreboard objectives setdisplay sidebar random
2. Setup a hopper clock runing on a commandblock with this command : /scoreboard players add @a random 1
3. You will see your score increasing
4. Kill you with the /kill command : your score doesn't increase anymore (the @a couldn't find you)

EDIT : ok doing more research it appears that none of the selector detect a player when he is dead (and haven't respawn yet). I'm not sure if it's a bug or intentional, but as described in the documentation, @a should target any player, without taking into account any other condition (ex : dead or not). A player dead is still a player and should be in the @a collection.

Original description : Since the 1.8 snapshots, deathcount objectives (or stats.deathcount, same problem) are updated when the player respawn, not when the player died as it was before. It should be updated when the player died.

Linked issues

Comments 50

I encountered the same problem, and it seems that it comes from the target selectors (@a, @p and @r), and not the scoreboard.

"/testfor @a" will ignore dead players until they respawn, but if you try "/scoreboard players list <player>", the deathCount objectives will be correct, even before the respawn. It's also clearly visible if you display the score in the sidebar. So it seems that the problem truly comes from the selectors, not the scoreboard.

I would advise you to do some tests around those additional informations and then update this issue, as it would help resolving it.

(ps : Bonjour aypierre ! Bon mapmaking ^^)

By the way, I wonder if this modification hasn't been made on purpose, since ignoring dead players can make sense in some cases (see MC-33778, which precisely asked for selectors to ignore dead players), but it completely breaks death detection as we know it, and there is no way to differentiate a death from a simple disconnection with the new behaviour.

I made some more experimentation and it seems, as Hartspoon commented, related to the target selectors. When you are dead, it seems that you are no longer a valid target for @a, and things like "/scoreboard player add @a randomobjectiv 1" add 1 only for the players alive.

It seems that it doesn't target any dead entities (mob during their death animation for example), so I'm pretty sure this was intended ...

The solution is to let the selectors count the dead players but with another parameter named, for example: "alive" and its value is a boolean so, we can select all the players alive, or all the players dead or both (@a[alive=true], @a[alive=false], @a[alive=both]).
This is a solution that everyone will agree, I think x')

40 more comments

Confirmed for 14w21b

/scoreboard player add @p Test 1

isn't working

Please reopen

No, I explicitly said before that only @a will work for dead players. Please read all comments before requesting that a ticket should be reopened.

Sorry for that. Could a moderator please add a note at the beginning of the report stating that only @a works for dead players. When you only read the title and the resolution it sounds rather like all selectors support dead players

@s/@a doesn't include dead player in 17w45a?

aymeric pierre

michael

Unconfirmed

Minecraft 14w04b, Minecraft 14w05a, Minecraft 14w06b, Minecraft 14w07a

Minecraft 14w10a

Retrieved