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
Place a boat and enter it
Use the following command
/tp @e[type=minecraft:boat,sort=nearest] ~ ~ ~5000
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
is duplicated by 9
relates to 2
Attachments
Comments 33
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.
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.
That is fascinating. What happens if you try to move? Dismount?