When using store success as / at, even if an entity is successfully executed, as long as one entity fails, 0 will be returned。
Reappearance:
1./scoreboard objectives add 123 dummy
2./execute store success score @s 123 as @e if entity @s[type=player]
Here, because there must be 1 player, the returned value should be 1, but even if the test passed in the chat, the scoreboard is still 0.
PS:Here is only the simplified version of command. I know how to use other commands to achieve the same effect, but it also means more commands. Therefore, if this is repaired, the command can be simplified and more intuitive.
#Using translation software, sorry#
The order in which the entities selected by
@e
are processed is arbitrary by default. Since your command is executed for each entity, the stored result is replaced each time it runs. Therefore the success score will only be1
if the last entity selected happens to be a player. Indeed, if you write@e[sort=random]
instead, you will see that the success score is sometimes0
and sometimes1
.