mojira.dev
MC-127980

distance argument for @s selector doesn't respect dimension

execute as @a at @s in the_nether if entity @a[distance=0] run say nether

correctly executes for each player in the nether but not for players in other dimensions.

execute as @a at @s in the_nether if entity @s[distance=0] run say nether

executes for all players regardless of dimension.

The distance check for @s appears to use the dimension of @s instead of the dimension where the command is being executed to calculate the distance to @s, thus making the if entity clause always true.

This also occurs when using positioned x y z or no positioning instead of at @s.

Comments 1

After further thought, this seems like it might be the correct behavior. If you think of @s as referencing the command execution context, then this is working correctly. If you think of @s as re-selecting the same entity that is executing the command, then this seems broken. Now that the former idea is also in my head, it definitely seems like the correct way of thinking about @s.

Jared Neil

(Unassigned)

Unconfirmed

Minecraft 18w14a

Retrieved