mojira.dev
MC-251570

Even if the entity is executed successfully, as long as there is an entity failure, the return of store success must be 0

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#

Attachments

Comments 2

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 be 1 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 sometimes 0 and sometimes 1.

Yeah, this is not a bug. If you want to get the results of the amount of players, don't use as/at, instead use /execute store result ... if entity @a, it you want it limited to a value, just add limit= to the selector.

The command you provided works as expected.

seven a

(Unassigned)

Unconfirmed

(Unassigned)

command

22w18a, 22w19a

Retrieved