When running this function
execute at @s run setblock ~ ~ ~ green_concrete
execute at @s in the_nether run tp @s ~ ~ ~
tellraw @a ["Dimension: ",{"nbt":"Dimension","entity":"@s"}]
execute at @s run setblock ~ ~1 ~ red_concrete
using the following command from within the overworld:
/execute as @e[type=pig,distance=..3] run function dimensions:test
I'd expect to find a green concrete block in front of me and a red one in the nether. Instead, I see a stack of a green and red concrete block, even though the tellraw reports the pig being in dimension -1.
This does not happen, when a player is teleported instead of a pig: Then everything works as expected and a green block is placed in the overworld, and a red one in the nether.
Linked issues
is duplicated by 1
Comments 9
To switch dimensions, non-player entities are entirely recreated, but `@s` still targets the previous entity. (`@e` and the uuid select the new entity)
This may be able to be resolved by adding a Dimension nbt tag to entities like players have. This would mean the entity is not resummoned and instead is actually moved.
That doesn't resolve the problem at all. The issue here is that when you teleport `@s` to another dimension it causes `@s` to no longer point at the correct entity, being able to get the dimension from NBT would not do anything here, and setting from NBT will almost certainly result in desyncs between client and server
Also affects 1.14.3