mojira.dev
MC-44514

Teleporting ridden entity in unloaded chunks does not cause chunks to load for riding player

The bug

Teleporting an entity which is ridden by a player into unloaded chunks teleports the player (client-side) but does not load the chunks.

In current versions, the player becomes stuck visually at their current position and their screen jitters, but the coordinates on the debug screen show that they moved some (but not the complete) distance.

In 1.18, the boat teleports but the player desyncs and cannot interact with anything that is not near the location where they typed the command.

As of 23w04a, teleporting the boat into unloaded chunks dismounts the player client-side. If the player tries breaking or placing blocks after running the command, these actions will generally be invalidated by the server, although in some circumstances they seem to work even though the server thinks the player is far away. The F3 coordinates seem to consistently reflect where the player appears to be (on the client). If the player runs /ride @s dismount or relogs, they will be teleported to the boat and will load the chunks around it.

How to reproduce

  1. Place a boat and enter it

  2. Use the following command

    /tp @e[type=minecraft:boat,sort=nearest] ~ ~ ~5000
  3. Enable the debug information
    → You will see that you were teleported (client-side), but using for example commands which print the block coordinates like /execute if block ~ ~ ~ air run say @s show that server-side you have not moved

The screenshots show a mounted horse before teleporting at 0,1000; the "void" after teleporting the horse; and the mounted horse at 0,5000 right after relogging.

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The reason is the same one as for MC-92916 and MC-108469: The method net.minecraft.world.World.updateEntityWithOptionalForce(Entity, boolean) does not update entities which are not in loaded chunks server-side. The problem here is that the riding player is not instantly moved with the ridden entity but instead when the method Entity.updateRidden() is called, which in this case never happens because the area around the ridden entity is not loaded.

Linked issues

Attachments

Comments 33

That is fascinating. What happens if you try to move? Dismount?

Rebecca König

No, your actions appear to have no effect until relogging at which point you're back on the horse.

Rebecca König

In 14w10a the horse vanishes instead of reappearing after relogging.

Rebecca König

This problem still exists in 14w28a and the horse is still vanishing.

Rebecca König

In 14w28b the horse reappears again after relogging but the basic issue still persists.

23 more comments

Maybe we could add the label "minecart" to this bug report, in addition to "boat" and "horse". Perhaps that would help get this issue noticed by Mojang. I've long wanted to extend my minecart system to include jumping from an overworld track to a track in the nether or the end, but this bug prevents that.

Can confirm in 1.18.1.

Can confirm in 1.19.2.

As of 23w04a, teleporting the boat into unloaded chunks dismounts the player client-side. If the player tries breaking or placing blocks after running the command, these actions will generally be invalidated by the server, although in some circumstances they seem to work even though the server thinks the player is far away. The F3 coordinates seem to consistently reflect where the player appears to be (on the client). If the player runs

/ride @s dismount

or relogs they will be teleported to the boat and will load the chunks around it.

This issue was fixed in 23w12a as part of the fix for [MC-201647]. However, passengers are not teleported instantaneously (as they are when teleporting them directly); it seems like the chunk they're being teleported to must finish loading first. I may decide to make a separate ticket for this.

Rebecca König

Asteraoth

(Unassigned)

Confirmed

Platform

Important

Entities, Networking, Player

boat, chunk, horse, mount, riding, teleport, unloaded-chunks

Minecraft 14w02b, Minecraft 14w02c, Minecraft 14w03a, Minecraft 14w05a, Minecraft 14w07a, ..., 1.18, 1.18.1, 1.19, 1.19.2, 23w04a

23w12a

Retrieved