mojira.dev
MC-123314

if/unless in execute does not work properly

/execute as @a at @s if block ~ ~-1 ~ stone run /say hi
This is supposed to make all players that are standing on stone say "hi" but instead it will target all players, even ones that are not on stone, as long as there is at least one player that is standing on stone.

I discovered this when i summoned some armor stands, i added some code to them to make it so that armor stands that go into a block would get deleted:

/execute as @e[type=armor_stand] at @s unless block ~ ~ ~ minecraft:air run /kill @s

but what happened is that if there was at least 1 armor stand in the air then none of them would get killed, even the ones that are inside blocks.

Linked issues

Comments 1

Same thing. I build "magnets" function. I expected that if one magnet is powered by redstone, it turns off. But all the magnets turns off if i do this.

Another example: my custom block armor stand will be killed only if i'll break all the blocks, not one.

Bluenade

(Unassigned)

Unconfirmed

Minecraft 17w50a

Retrieved