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.

Related issues

Attachments

Comments

migrated
[media][media][media][media]
Torabi

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

migrated

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

migrated

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

migrated

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

migrated

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

migrated

In 14w32b the player gets teleported but only half of the world loads before relogging. The part that's not loaded includes the player's position.

migrated

confirmed for 14w32b

migrated

In 14w34d loading the world after teleporting works from time to time but I'm floating over the ground and the horse is gone. As before, this is fixed by relogging.

migrated

This bug is still happening in the first pre-release, 8 months after submitting.

migrated

Great job Mojang, this was reported for the second snapshot and is still in the release.

migrated

I see this as well in 1.8.3, it occurs if you teleport the horse too far while riding it:

/tp @e[type=EntityHorse] ~81 ~ ~
OR
/tp @e[type=EntityHorse] ~-80 ~ ~

Anything less than those distances works fine as intended.

After teleporting, you can move but slowly and you'll hear your horse but it is invisible and you'll be back at ground level. If you dismount, you can move fine, but your horse will be invisible until unknown conditions occur (or relogging). Staying on the horse and relogging shows you fine on the horse.

migrated

It looks like in 14w10c (the same issue occurs at the same distances) that if I dismount the horse and move a couple blocks away the horse reappears, this is not the case in 1.8.3.

migrated

Tested the Y direction, works fine.

Also tried teleporting other mobs long distances and discovered that they disappear too! At least until the player moves/looks around a bit. For instance if I teleport a Spider Jockey 100 blocks away into the daylight near my position now, I'll hear him burning, but until I move a bit, I won't see him.

Seems like another bug or maybe related to this same issue? Maybe related to MC-65040

It also appears that the horse teleports visually before the player does, I see the horse for a brief instance in the distance before I move, but then the horse is invisible.

As a player, you're stuck on the horse and get snapped back to its location if you try and move. You can dismount, but the horse is still invisible.

migrated

Thanks for testing, I've updated the version. Btw, the Y axis is fine because it has no effect on chunk loading.

migrated

Thanks for updating the version. I don't think it has as much to do with chunk loading as rendering. Because you'll hear the mob still, so it knows it's there, you just can't see it.

I tested this out in multiplayer too. On your own machine, you get stuck and the horse is invisible. But if you see someone do it, you'll still see them on the horse (though sometimes it takes a bit or you have to look around a bit, probably related to MC-65040). Of course, since they're stuck, you won't see them moving.

Leads me to believe it's a local-client issue as if another player sees things properly then the server must have the proper info.

onnowhere

Still occurring 15w49b. In the few tests I did, I so far got the following results on render distance 8:

  • Teleported into unloaded chunks (I used ~200 ~ ~), world is not loading until relog which takes me back to where I was before getting on the horse because the world did not seem to have saved

  • Teleported into unloaded chunks (I used ~200 ~ ~), world is not loading. Relogged, and now I'm on the horse in the right spot but I can't move or dismount until it is killed.

  • Teleported into nearby chunks (I used ~100 ~ ~), I fell to the ground at the original spot, gameticks stop running for a second, then things update and now I'm back on the horse in the correct spot.

migrated

I think this behavior may be changed (but still broken in a slightly different way) in 15w51b

migrated

Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.

This is an automated comment on any open or reopened issue with out-of-date affected versions.

Asteraoth

Confirmed for 1.13-pre8

Asteraoth

Confirmed for 1.13

Asteraoth

Confirmed for 18w30b

Asteraoth

Note: Teleporting the boat in 1.14.3 caused

[media]

to happen.

violine1101

Can confirm; the ticket's description is no longer up to date though. The player just gets stuck in the original location and isn't actually teleported.

pulpetti

Affects 1.16.1 and 20w29a

[Mod] markderickson

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05b.

Avoma

Can confirm in 21w06a.

migrated

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.

Avoma

Can confirm in 1.18.1.

Avoma

Can confirm in 1.19.2.

clamlol

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.

clamlol

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.

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