mojira.dev
MC-149334

Can no longer teleport to an entity summoned into a currently unloaded chunk

Prior to 1.14 one used to be able to use mcfunctions to summon an entity (armor_stand, area_effect_cloud, etc) [edit] and then move it /edit into even a currently unloaded chunk, and then teleport the player to that entity's coordinates, in order to teleport a player to far away places (like for adventure maps and such) based on scoreboard stored coordinates.

With the release of 1.14, all such functions are broken.

 Example:

summon armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,PersistenceRequired:1b,CustomName:"{\"text\":\"teleport\"}"}

execute as @s at @s store result entity @e[name=teleport,limit=1] Pos[0] double 1 run scoreboard players get @e[tag=Clerk,limit=1] gat_1gold2x

execute as @s at @s store result entity @e[name=teleport,limit=1] Pos[1] double 1 run scoreboard players get @e[tag=Clerk,limit=1] gat_1gold2y

execute as @s at @s store result entity @e[name=teleport,limit=1] Pos[2] double 1 run scoreboard players get @e[tag=Clerk,limit=1] gat_1gold2z

tp @s @e[name=teleport,limit=1]

kill @e[name=teleport]

This will have massive negative repercussions on any and all adventure maps / minigames / worlds where it is necessary to move the player around as they progress through the experience based on scoreboard-tracked coordinates.

Comments 12

You could not summon entities in unloaded chunks even before 1.14. You can however load chunks using /forceload or using /setworldspawn.

Yes, you could [edit] to clarify, it's true you couldn't SUMMON an entity into an unloaded chunk, but I didn't say that. You could TELEPORT an entity summoned into the unloaded chunk (as stated in the unedited title) /edit. It worked until the update yesterday. Now it doesn't in 1.14,

[edit] but actually still can in 1.13.2 retro.

Demonstration video made just now here:
[edit] added a new clip which shows the game load (so you can be sure no distant chunks are loaded) and shows the f3 so you can see the distance being teleported is clearly to an unloaded chunk thousands of blocks away.
https://clips.twitch.tv/CrepuscularThirstyPlumber4Head

You can see, after I arrive into the new location, the chunks are unloaded, and start loading in around me.

That is teleporting player to a summoned entity which was moved into an unloaded chunk 2000+ blocks away using the script based as posted above.

Ah, thanks for the explanation. Reopened. This is probably a side effect of the chunk loading and entity caching procedure being completely revamped in 1.14 and therefore might be working as intended.

Thank you violine1101 for taking a look at it. I "hope" it's not as intended, because this would make teleporting a player to a scoreboard-stored coordinate in one tick impossible, and over a period of ticks dangerous to the player.

To begin, you can't set a player's posX posY posZ directly like you can an entity, so the player must tp to change his pos.

Since you can no longer move an entity into an unloaded chunk and then tp the player to it, a potential work around would be to teleport the player himself around while simultaneously subtracting from his coordinate score, until he reaches the intended coordinate, and his coordinate score is zero. BUT you can't teleport a player more than once per script run-through (tick), because, as is, FOR A PLAYER, Minecraft executes only the last tp coordinates given within the same tick(script-run-through), ignoring all prior tp commands given in the same tick.

Thus the current conundrum in 1.14:
1. You can tp an entity to a scoreboard number, but not if that is to an unloaded chunk.
2. You can tp a player to an unloaded chunk, but can only specify one set of coordinates per tick, and thus can't incrementally arrive at a desired coordinate as stored in a scoreboard in one tick.
3. You can't force-load a chunk based on a scoreboard value to get around this conundrum.

Any map/minigame/adventure-maker will need to incrementally move the player one step per tick to get him to a scoreboard-stored location. Not only will this be a slow tp... it could also be potentially lethal to the player as he slowly teleports through solid blocks and lava enroute. Eek!

Script to incrementally move an entity does not work with players, as Minecraft will only execute one successful tp command given within the same script run-through, ignoring all others.

#Positive x direction
tp @s[scores={gat_1gold1x=16777216..}] ~16777216 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=16777216..}] gat_1gold1x 16777216

tp @s[scores={gat_1gold1x=8388608..}] ~8388608 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=8388608..}] gat_1gold1x 8388608

tp @s[scores={gat_1gold1x=4194304..}] ~4194304 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=4194304..}] gat_1gold1x 4194304

tp @s[scores={gat_1gold1x=2097152..}] ~2097152 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=2097152..}] gat_1gold1x 2097152

tp @s[scores={gat_1gold1x=1048576..}] ~1048576 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=1048576..}] gat_1gold1x 1048576

tp @s[scores={gat_1gold1x=524288..}] ~524288 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=524288..}] gat_1gold1x 524288

tp @s[scores={gat_1gold1x=262144..}] ~262144 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=262144..}] gat_1gold1x 262144

tp @s[scores={gat_1gold1x=131072..}] ~131072 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=131072..}] gat_1gold1x 131072

tp @s[scores={gat_1gold1x=65536..}] ~65536 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=65536..}] gat_1gold1x 65536

tp @s[scores={gat_1gold1x=32768..}] ~32768 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=32768..}] gat_1gold1x 32768

tp @s[scores={gat_1gold1x=16384..}] ~16384 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=16384..}] gat_1gold1x 16384

tp @s[scores={gat_1gold1x=8192..}] ~8192 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=8192..}] gat_1gold1x 8192

tp @s[scores={gat_1gold1x=4096..}] ~4096 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=4096..}] gat_1gold1x 4096

tp @s[scores={gat_1gold1x=2048..}] ~2048 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=2048..}] gat_1gold1x 2048

tp @s[scores={gat_1gold1x=1024..}] ~1024 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=1024..}] gat_1gold1x 1024

tp @s[scores={gat_1gold1x=512..}] ~512 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=512..}] gat_1gold1x 512

tp @s[scores={gat_1gold1x=256..}] ~256 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=256..}] gat_1gold1x 256

tp @s[scores={gat_1gold1x=128..}] ~128 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=128..}] gat_1gold1x 128

tp @s[scores={gat_1gold1x=64..}] ~64 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=64..}] gat_1gold1x 64

tp @s[scores={gat_1gold1x=32..}] ~32 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=32..}] gat_1gold1x 32

tp @s[scores={gat_1gold1x=16..}] ~16 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=16..}] gat_1gold1x 16

tp @s[scores={gat_1gold1x=8..}] ~8 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=8..}] gat_1gold1x 8

tp @s[scores={gat_1gold1x=4..}] ~4 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=4..}] gat_1gold1x 4

tp @s[scores={gat_1gold1x=2..}] ~2 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=2..}] gat_1gold1x 2

tp @s[scores={gat_1gold1x=1..}] ~1 ~ ~
scoreboard players remove @s[scores={gat_1gold1x=1..}] gat_1gold1x 1

#Negative x direction
tp @s[scores={gat_1gold1x=..-16777216}] ~-16777216 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-16777216}] gat_1gold1x 16777216

tp @s[scores={gat_1gold1x=..-8388608}] ~-8388608 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-8388608}] gat_1gold1x 8388608

tp @s[scores={gat_1gold1x=..-4194304}] ~-4194304 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-4194304}] gat_1gold1x 4194304

tp @s[scores={gat_1gold1x=..-2097152}] ~-2097152 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-2097152}] gat_1gold1x 2097152

tp @s[scores={gat_1gold1x=..-1048576}] ~-1048576 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-1048576}] gat_1gold1x 1048576

tp @s[scores={gat_1gold1x=..-524288}] ~-524288 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-524288}] gat_1gold1x 524288

tp @s[scores={gat_1gold1x=..-262144}] ~-262144 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-262144}] gat_1gold1x 262144

tp @s[scores={gat_1gold1x=..-131072}] ~-131072 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-131072}] gat_1gold1x 131072

tp @s[scores={gat_1gold1x=..-65536}] ~-65536 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-65536}] gat_1gold1x 65536

tp @s[scores={gat_1gold1x=..-32768}] ~-32768 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-32768}] gat_1gold1x 32768

tp @s[scores={gat_1gold1x=..-16384}] ~-16384 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-16384}] gat_1gold1x 16384

tp @s[scores={gat_1gold1x=..-8192}] ~-8192 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-8192}] gat_1gold1x 8192

tp @s[scores={gat_1gold1x=..-4096}] ~-4096 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-4096}] gat_1gold1x 4096

tp @s[scores={gat_1gold1x=..-2048}] ~-2048 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-2048}] gat_1gold1x 2048

tp @s[scores={gat_1gold1x=..-1024}] ~-1024 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-1024}] gat_1gold1x 1024

tp @s[scores={gat_1gold1x=..-512}] ~-512 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-512}] gat_1gold1x 512

tp @s[scores={gat_1gold1x=..-256}] ~-256 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-256}] gat_1gold1x 256

tp @s[scores={gat_1gold1x=..-128}] ~-128 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-128}] gat_1gold1x 128

tp @s[scores={gat_1gold1x=..-64}] ~-64 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-64}] gat_1gold1x 64

tp @s[scores={gat_1gold1x=..-32}] ~-32 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-32}] gat_1gold1x 32

tp @s[scores={gat_1gold1x=..-16}] ~-16 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-16}] gat_1gold1x 16

tp @s[scores={gat_1gold1x=..-8}] ~-8 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-8}] gat_1gold1x 8

tp @s[scores={gat_1gold1x=..-4}] ~-4 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-4}] gat_1gold1x 4

tp @s[scores={gat_1gold1x=..-2}] ~-2 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-2}] gat_1gold1x 2

tp @s[scores={gat_1gold1x=..-1}] ~-1 ~ ~
scoreboard players add @s[scores={gat_1gold1x=..-1}] gat_1gold1x 1

#Positive z direction
tp @s[scores={gat_1gold1z=16777216..}] ~ ~ ~16777216
scoreboard players remove @s[scores={gat_1gold1z=16777216..}] gat_1gold1z 16777216

tp @s[scores={gat_1gold1z=8388608..}] ~ ~ ~8388608
scoreboard players remove @s[scores={gat_1gold1z=8388608..}] gat_1gold1z 8388608

tp @s[scores={gat_1gold1z=4194304..}] ~ ~ ~4194304
scoreboard players remove @s[scores={gat_1gold1z=4194304..}] gat_1gold1z 4194304

tp @s[scores={gat_1gold1z=2097152..}] ~ ~ ~2097152
scoreboard players remove @s[scores={gat_1gold1z=2097152..}] gat_1gold1z 2097152

tp @s[scores={gat_1gold1z=1048576..}] ~ ~ ~1048576
scoreboard players remove @s[scores={gat_1gold1z=1048576..}] gat_1gold1z 1048576

tp @s[scores={gat_1gold1z=524288..}] ~ ~ ~524288
scoreboard players remove @s[scores={gat_1gold1z=524288..}] gat_1gold1z 524288

tp @s[scores={gat_1gold1z=262144..}] ~ ~ ~262144
scoreboard players remove @s[scores={gat_1gold1z=262144..}] gat_1gold1z 262144

tp @s[scores={gat_1gold1z=131072..}] ~ ~ ~131072
scoreboard players remove @s[scores={gat_1gold1z=131072..}] gat_1gold1z 131072

tp @s[scores={gat_1gold1z=65536..}] ~ ~ ~65536
scoreboard players remove @s[scores={gat_1gold1z=65536..}] gat_1gold1z 65536

tp @s[scores={gat_1gold1z=32768..}] ~ ~ ~32768
scoreboard players remove @s[scores={gat_1gold1z=32768..}] gat_1gold1z 32768

tp @s[scores={gat_1gold1z=16384..}] ~ ~ ~16384
scoreboard players remove @s[scores={gat_1gold1z=16384..}] gat_1gold1z 16384

tp @s[scores={gat_1gold1z=8192..}] ~ ~ ~8192
scoreboard players remove @s[scores={gat_1gold1z=8192..}] gat_1gold1z 8192

tp @s[scores={gat_1gold1z=4096..}] ~ ~ ~4096
scoreboard players remove @s[scores={gat_1gold1z=4096..}] gat_1gold1z 4096

tp @s[scores={gat_1gold1z=2048..}] ~ ~ ~2048
scoreboard players remove @s[scores={gat_1gold1z=2048..}] gat_1gold1z 2048

tp @s[scores={gat_1gold1z=1024..}] ~ ~ ~1024
scoreboard players remove @s[scores={gat_1gold1z=1024..}] gat_1gold1z 1024

tp @s[scores={gat_1gold1z=512..}] ~ ~ ~512
scoreboard players remove @s[scores={gat_1gold1z=512..}] gat_1gold1z 512

tp @s[scores={gat_1gold1z=256..}] ~ ~ ~256
scoreboard players remove @s[scores={gat_1gold1z=256..}] gat_1gold1z 256

tp @s[scores={gat_1gold1z=128..}] ~ ~ ~128
scoreboard players remove @s[scores={gat_1gold1z=128..}] gat_1gold1z 128

tp @s[scores={gat_1gold1z=64..}] ~ ~ ~64
scoreboard players remove @s[scores={gat_1gold1z=64..}] gat_1gold1z 64

tp @s[scores={gat_1gold1z=32..}] ~ ~ ~32
scoreboard players remove @s[scores={gat_1gold1z=32..}] gat_1gold1z 32

tp @s[scores={gat_1gold1z=16..}] ~ ~ ~16
scoreboard players remove @s[scores={gat_1gold1z=16..}] gat_1gold1z 16

tp @s[scores={gat_1gold1z=8..}] ~ ~ ~8
scoreboard players remove @s[scores={gat_1gold1z=8..}] gat_1gold1z 8

tp @s[scores={gat_1gold1z=4..}] ~ ~ ~4
scoreboard players remove @s[scores={gat_1gold1z=4..}] gat_1gold1z 4

tp @s[scores={gat_1gold1z=2..}] ~ ~ ~2
scoreboard players remove @s[scores={gat_1gold1z=2..}] gat_1gold1z 2

tp @s[scores={gat_1gold1z=1..}] ~ ~ ~1
scoreboard players remove @s[scores={gat_1gold1z=1..}] gat_1gold1z 1

#Negative z direction
tp @s[scores={gat_1gold1z=..-16777216}] ~ ~ ~-16777216
scoreboard players add @s[scores={gat_1gold1z=..-16777216}] gat_1gold1z 16777216

tp @s[scores={gat_1gold1z=..-8388608}] ~ ~ ~-8388608
scoreboard players add @s[scores={gat_1gold1z=..-8388608}] gat_1gold1z 8388608

tp @s[scores={gat_1gold1z=..-4194304}] ~ ~ ~-4194304
scoreboard players add @s[scores={gat_1gold1z=..-4194304}] gat_1gold1z 4194304

tp @s[scores={gat_1gold1z=..-2097152}] ~ ~ ~-2097152
scoreboard players add @s[scores={gat_1gold1z=..-2097152}] gat_1gold1z 2097152

tp @s[scores={gat_1gold1z=..-1048576}] ~ ~ ~-1048576
scoreboard players add @s[scores={gat_1gold1z=..-1048576}] gat_1gold1z 1048576

tp @s[scores={gat_1gold1z=..-524288}] ~ ~ ~-524288
scoreboard players add @s[scores={gat_1gold1z=..-524288}] gat_1gold1z 524288

tp @s[scores={gat_1gold1z=..-262144}] ~ ~ ~-262144
scoreboard players add @s[scores={gat_1gold1z=..-262144}] gat_1gold1z 262144

tp @s[scores={gat_1gold1z=..-131072}] ~ ~ ~-131072
scoreboard players add @s[scores={gat_1gold1z=..-131072}] gat_1gold1z 131072

tp @s[scores={gat_1gold1z=..-65536}] ~ ~ ~-65536
scoreboard players add @s[scores={gat_1gold1z=..-65536}] gat_1gold1z 65536

tp @s[scores={gat_1gold1z=..-32768}] ~ ~ ~-32768
scoreboard players add @s[scores={gat_1gold1z=..-32768}] gat_1gold1z 32768

tp @s[scores={gat_1gold1z=..-16384}] ~ ~ ~-16384
scoreboard players add @s[scores={gat_1gold1z=..-16384}] gat_1gold1z 16384

tp @s[scores={gat_1gold1z=..-8192}] ~ ~ ~-8192
scoreboard players add @s[scores={gat_1gold1z=..-8192}] gat_1gold1z 8192

tp @s[scores={gat_1gold1z=..-4096}] ~ ~ ~-4096
scoreboard players add @s[scores={gat_1gold1z=..-4096}] gat_1gold1z 4096

tp @s[scores={gat_1gold1z=..-2048}] ~ ~ ~-2048
scoreboard players add @s[scores={gat_1gold1z=..-2048}] gat_1gold1z 2048

tp @s[scores={gat_1gold1z=..-1024}] ~ ~ ~-1024
scoreboard players add @s[scores={gat_1gold1z=..-1024}] gat_1gold1z 1024

tp @s[scores={gat_1gold1z=..-512}] ~ ~ ~-512
scoreboard players add @s[scores={gat_1gold1z=..-512}] gat_1gold1z 512

tp @s[scores={gat_1gold1z=..-256}] ~ ~ ~-256
scoreboard players add @s[scores={gat_1gold1z=..-256}] gat_1gold1z 256

tp @s[scores={gat_1gold1z=..-128}] ~ ~ ~-128
scoreboard players add @s[scores={gat_1gold1z=..-128}] gat_1gold1z 128

tp @s[scores={gat_1gold1z=..-64}] ~ ~ ~-64
scoreboard players add @s[scores={gat_1gold1z=..-64}] gat_1gold1z 64

tp @s[scores={gat_1gold1z=..-32}] ~ ~ ~-32
scoreboard players add @s[scores={gat_1gold1z=..-32}] gat_1gold1z 32

tp @s[scores={gat_1gold1z=..-16}] ~ ~ ~-16
scoreboard players add @s[scores={gat_1gold1z=..-16}] gat_1gold1z 16

tp @s[scores={gat_1gold1z=..-8}] ~ ~ ~-8
scoreboard players add @s[scores={gat_1gold1z=..-8}] gat_1gold1z 8

tp @s[scores={gat_1gold1z=..-4}] ~ ~ ~-4
scoreboard players add @s[scores={gat_1gold1z=..-4}] gat_1gold1z 4

tp @s[scores={gat_1gold1z=..-2}] ~ ~ ~-2
scoreboard players add @s[scores={gat_1gold1z=..-2}] gat_1gold1z 2

tp @s[scores={gat_1gold1z=..-1}] ~ ~ ~-1
scoreboard players add @s[scores={gat_1gold1z=..-1}] gat_1gold1z 1

That function doesn't work because you're constantly using the same command context for the teleportation. The whole function is run with the same context. So running this: `execute as @a at @s run function example`
example:

teleport @s ~ ~1 ~
teleport @s ~ ~1 ~
teleport @s ~ ~1 ~
teleport @s ~ ~1 ~

would only teleport the player 1 block up since they all use the same origin. To 'update' the position context, you need to use `at @s` before teleporting, so the teleport command uses the new player pos as the context.

teleport @s ~ ~1 ~
execute at @s run teleport @s ~ ~1 ~
execute at @s run teleport @s ~ ~1 ~
execute at @s run teleport @s ~ ~1 ~

so it's not impossible

2 more comments

A workaround for this is to execute a function as the armor stand because "@s" doesn't get lost (like Alluet suggested): 

tag @s add teleport2
summon armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,Tags:["teleport"]}
execute as @e[tag=teleport] run function 1:1
tag @s remove teleport2
#this is function 1:1
execute store result entity @s Pos[0] double 1 run scoreboard players get @e[tag=Clerk,limit=1] gat_1gold2x
execute store result entity @s Pos[1] double 1 run scoreboard players get @e[tag=Clerk,limit=1] gat_1gold2y
execute store result entity @s Pos[2] double 1 run scoreboard players get @e[tag=Clerk,limit=1] gat_1gold2z
tp @a[tag=teleport2] @s
kill @s

Can confirm: if you execute the function/command as the armor stand itself, then it works. I use the system for a sethome/home system.

It broke during the 1.14 snapshots. But updating the data pack so that the armor stand executes the teleport, works. Someone told me to use that since when something is the target (as @s), it doesn't get unloaded from memory.

System now works again.

Is the following problem related to this?
Teleporting a player to an unloaded chunk and summoning an entity in that chunk in the same tick does not work anymore in 1.14.

Example:
Position 0 0 0 is inside an unloaded chunk.
I have the following mcfunction:

tp @a 0 0 0
summon armor_stand 0 0 0

Running the function will result in the player being teleported, without the armor_stand being summoned.

Is this still the case in 21w11a?

Is this still an issue in 1.17.1? If it is, please update the affected versions. Thanks!

Gatinh0

(Unassigned)

Confirmed

Normal

Commands

mojang_internal_1

Minecraft 1.14

Retrieved