-
Bug
-
Resolution: Fixed
-
Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 1.8.6, Minecraft 1.8.7, Minecraft 1.8.8, Minecraft 15w49b, Minecraft 1.8.9, Minecraft 16w03a, Minecraft 16w04a, Minecraft 16w07b, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w21b, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w40a, Minecraft 1.11.2
-
Confirmed
-
Creative
The problem:
The argument "c" in selectors (e.g. "@e[c=1]") is supposed to limit the amount of entities targeted by the selector to the x closest (for c=x) or x furthest (for c=-x) entities, sorted by their distance. However, when used inside a scoreboard command (e.g. "scoreboard players set @e[c=1,r=10] something 0") the selector will first "fill" the available slots with all players that match the remaining criteria, regardless of their distance (compared to other matching entities). When the limit was not reached with player entities alone, other entities will be processed like expected (based on their distance that is).
How to reproduce:
Start by creating an objective
/scoreboard objectives add demo dummy
and set up the sidebar so you can see it
/scoreboard objectives setdisplay sidebar demo
Now just place a command block down and put in a command like
/scoreboard players add @e[c=1,r=3] demo 1
Finally, place down an entity (i recommend an Armor stand) next to the command block.
When you activate the cmd block outside the range (in my example 3), the entity will get a new score. As soon as you are near enough (again, 3 blocks in my example), you will be targeted instead, even if the entity you use is standing between you and the cmd block (which makes it clearly the closer one).
Affects:
- Most /scoreboard commands (excluding /scoreboard teams <join|leave> and /scoreboard players tag <target> <add|remove>).
- The name shown in green from the results of /scoreboard players tag <target> <list> (though the list of tags shown in white is from the correct target).
- The stored selector for CommandStats.
Also note skylinerw's comment and code analysis.
- is duplicated by
-
MC-79103 The c=1 argument does not behave correctly in a scoreboard command within an execute
- Resolved
-
MC-81152 scoreboard command interacts wrong with execute
- Resolved
-
MC-96356 Scoreboard command entity selector prefers players
- Resolved
-
MC-101544 Scoreboard Command With @e[c=x] Selector Always Selects Players First
- Resolved
-
MC-102262 /stats entity set ... problem
- Resolved
-
MC-103690 dubious execute/scoreboard/@e interaction
- Resolved
-
MC-112339 '@r' target selector in scoreboard commands ignores "not equal to" arguments about entity type
- Resolved
- relates to
-
MC-78006 Closest entity selector doesn't always find itself.
- Open
-
MC-55510 @p not targetting closest player correctly.
- Resolved
-
MC-80216 @e[c=1] error
- Resolved
-
MC-80893 Sender bias (c=1) applies when sender is not the closest entity to specified x/y/z origin
- Resolved