General usage
In 1.12, running the following command in the Overworld will cause all "anchor" entities to set a block at their location, but restricted to their dimension. If there was an anchor in the End, the stone would appear correctly at their location:
execute @e[tag=anchor] ~ ~ ~ setblock ~ ~ ~ minecraft:stone
However, in 1.13 the following command will place the block only in the Overworld (provided the command is run in the Overworld). If an anchor exists in the End, they will place the block at their coordinates but only in the Overworld:
execute as @e[tag=end] at @s run setblock ~ ~ ~ minecraft:stone
If the command were instead run in the End, the anchor in the End would have the block placed correctly at their location. But if there were also an anchor in the Overworld, another block would appear in the End with the coordinates of the anchor in the Overworld.
How to reproduce
Use the following command in the overworld
/summon armor_stand 10 10 10 {NoGravity:1b,Tags:["anchor"]}
Get to the nether and use the following command
/execute as @e[tag=anchor] run setblock ~ ~ ~ stone_slab
Teleport to the position in the nether
/teleport 10 10 10
World-binding params
There are a handful of "world-binding parameters" that lock the dimension of execution to that of the command sender, being: x/y/z/dx/dy/dz/distance
. If none of these parameters are present, the selector will obtain targets from any dimension. If any of these parameters are present, the selector will only obtain targets from the command sender's dimension.
In 1.12, the following would cause the "anchor" entity to state the name of a player around them, regardless of which dimension the /execute
command originated from. For example, if the command were run via command block in the Overworld while the anchor was in the End, it would still work:
execute @e[tag=anchor] ~ ~ ~ say Players around me: @a[r=5]
However, in 1.13 the dimension will always be locked to the original dimension. If the command block were in the Overworld and the anchor were in the End, the following command fails due to the dimension remaining as the Overworld:
execute as @e[tag=anchor] at @s run say Players around me: @a[distance=..5]
Likewise, if the command block originated in the End, the above command works so long as the anchor is also in the End (and fails if the anchor is in the Overworld).
Linked issues
is duplicated by 7
Comments 3
Still exists in 18w01a, put in a bug, when searching didn't find this one, my bug dealt with functions and has some attached MC-123958 <dupe bug to this one apparently
Still exists in 17w50a. I noticed it when trying to make an item counter that detected @e[type=item,distance=0..1] around armor_stands. It only worked in the dimension it was executed from.
I also confirmed it by spawning chickens at armor_stands, which is similar to the test case of setting blocks to stone.