mojira.dev
MC-4686

Client movement when teleported

The bug

Currently, when teleporting a player (either relatively or absolutely) the motion of the teleport is visible sometimes, but not always. This behaviour is inconsistent even at 60fps.

How to reproduce

  1. Make two identical buildings 16 blocks apart from each other on the worlds X axis

  2. Keep executing the following two commands

    /tp ~16 ~ ~
    /tp ~-16 ~ ~

    → Note the occasional flash in between the teleports

Results

When a teleportation occurs, a flash is sometimes seen. Sometimes blocks even disappear until you move your mouse.

This flash is caused by extra frames generated during the teleportation. Causing an image to be rendered from the position in between the start position and the destination. The disappearing blocks is a different issue that deserves its own ticket.

Expected

To either not see a flash at all, or see it all the time (at 60fps).

Possible fix

It appears that this happens because only one of the two previous position fields is updated when teleporting. Specifically, setPositionAndRotation updates prevPosX/Y/Z, but leaves lastTickX/Y/Z alone. Both of these fields are used to interpolate position (each in different contexts), and only using one causes this bug. (Side note: I'm not entirely sure why there are two fields that have more or less the same purpose - perhaps they can be merged).

This is my (@unknown) fix (in NetHandlerPlayClient.handlePlayerPosLook):

EntityPlayer player = this.gameController.player;
double x = packetIn.getX();
double y = packetIn.getY();
double z = packetIn.getZ();
float yaw = packetIn.getYaw();
float pitch = packetIn.getPitch();

if (packetIn.getFlags().contains(SPacketPlayerPosLook.EnumFlags.X))
{
    player.lastTickPosX += x;
    player.chasingPosX += x;
    player.prevChasingPosX += x;
    x += player.posX;
}
else
{
    player.lastTickPosX = x;
    player.chasingPosX = x;
    player.prevChasingPosX = x;
    player.motionX = 0.0D;
}

if (packetIn.getFlags().contains(SPacketPlayerPosLook.EnumFlags.Y))
{
    player.lastTickPosY += y;
    player.chasingPosY += y;
    player.prevChasingPosY += y;
    y += player.posY;
}
else
{
    player.lastTickPosY = y;
    player.chasingPosY = y;
    player.prevChasingPosY = y;
    player.motionY = 0.0D;
}

if (packetIn.getFlags().contains(SPacketPlayerPosLook.EnumFlags.Z))
{
    player.lastTickPosZ += z;
    player.chasingPosZ += z;
    player.prevChasingPosZ += z;
    z += player.posZ;
}
else
{
    player.lastTickPosZ = z;
    player.chasingPosZ = z;
    player.prevChasingPosZ = z;
    player.motionZ = 0.0D;
}

I update lastTickPosX/Y/Z by the delta if it is a relative teleport, and set it directly if it is an absolute teleport. Changing it by the delta is important - if we just set it to the new position, then there actually is a (subtle) pause as the camera stays in the new position for the entire tick rather than moving between the offset old position and the new position.

I also update prevChasingPos/chasingPosX/Y/Z, which are used to render capes. This keeps capes from spazing out when teleporting (but isn't too important to the core problem).

I don't touch prevPosX/Y/Z at all in this code, simply because any changes made would be overwritten by the call to setPositionAndRotation. It may be better to also adjust prevPosX/Y/Z by the delta, but I couldn't detect a significant difference and that would require tweaking setPositionAndRotation.

(note that MC-120545 needs to also be fixed for seamless teleporting)

Related issues

Attachments

Comments

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

Still in 13w10a

kumasasa

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

migrated

It's still in existence in 1.5.1. It's actually causing problems in a custom map that I'm making. I frequently need to teleport the player to rooms that look almost the same as the room they were in. It's supposed to be unnoticeable, but since this bug exists there is somewhat of a 'flash' when they teleport.

In my opinion, teleportation should be seamless, without rendering of the space between the start and end locations in-between the two ticks.

migrated

my issue might be related/a duplicate of this issue: MC-14861

migrated

confirmed for 13w17a

If you want to fix this you have to fixt these 3 things:
-stop the hand from moving when teleported
-make sure you don't see any frames during the teleportation
-make sure the velocity stays the same when you teleport

migrated

confirmed for 13w18c

migrated

confirmed for 13w19a

migrated

The hand was moving because of a button press, not because of teleportation. Also, velocity isn't changed by teleportation. This glitch is caused by the way Minecraft renders frames in-between ticks in order to produce smoother-looking animation.

migrated

try teleporting using a command you typed in chat, you will see your hand moving
and yes the velocity is reset when teleporting. Just fly up very high in creative, let yourself fall. and use /tp @p ~0 ~0 ~1 and you will see you start to fall again.
Sure, this glitch is also caused by the frames in-between ticks. But if you don't want to see the teleportation, mojang has to fix all of these 3 issues.

migrated

confirmed for 13w21b

migrated

confirmed for 13w26a

migrated

well, I guess we're just going to have to all play at 20 fps

migrated

this might be fixed in 13w41a or maybe I'm just having a lot of lagg. I'll do more testing...

migrated

ok so it is sort of fixed in 13w41a you do not see the movement but your velocity will still be reset and sometimes your hand moves. Resolve as fixed or keep it open?

galaxy_2alex

Is this still a concern in the latest developement Minecraft version 14w03b / Launcher version 1.3.8 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

trazlander

Ya this was fixed back in January or so https://twitter.com/Dinnerbone/status/420956915578179584

kumasasa

Ok, resolved.

migrated

This bug is back in the latest snapshots (14w32d) can a mod reopen this issue?

migrated

confirmed for 14w34b

migrated

Confirmed for 1.8-pre1

migrated

Confirmed for 1.8-pre3

migrated

Confirmed for 1.8

migrated

Maybe they should make a teleport an actual, INSTANTANEOUS teleport. The way you see entities and players fly off when teleported, along with this issue, both imply that it's actually just a very very fast noclip movement, which is obviously why it sometimes shows crap in-between.

migrated

Well it was fixed for a while, but the problem came back when the new render system was implemented.

migrated

Confirmed for 1.8.1-pre3

migrated

Confirmed for 1.8.1-pre4

migrated

Confirmed for 1.8.1

migrated

Then ask mojang to delete that new render system and teleportation will become more seamless.

migrated

Please fix it for minecraft! And teleportation maps.

migrated

Once and for all!

migrated

I hate this bug so much. It ruined every single hidden teleportation.

migrated

Confirmed for 1.8.1. (Mojang, for WHAT reason did you put this bug back in?)

migrated

Maybe this bug is caused because of the new render system.

migrated

Block's won't render when you are not looking at them.

migrated

When you freakin gonna fix it mojang??
Fix FIX FIX FIX FIX FIX FIX FIX FIX AND FIX FIX Every tp bug! Make teleports as seamless and as hidden as Possible as soon as possible please! And make sure that annoying stupid bug never comes back. If u can.

migrated

By the way Alexander bakradze is my old account.

migrated

There are over 3000 unresolved bugs. Be patient.

migrated

Has this problem been flixed or even worked on in the newest 15w35e snapshot? Because I would really love to see it fixed because I use teleports a lot to make minecraft adventure maps and those few frames between teleports ruin the experience.

migrated

Confirmed for 15w35e

migrated

Why don't they just add a special tag for "Instant"
Like: /tp (target) ❌ 👍 (z) [instant] or /tp (target) (2nd target) [instant]
It defaults to false, for a smooth teleport.
If set to true, it will teleport without moving the hand and it won't have any in-between frames.

It seems like a good idea to me _

migrated

So have a tag to determine whether the bug happens or not? Great idea! Or, they could just fix the bug, and not waste time adding a useless tag.

migrated

Well I have actually quite some situations where I could really benefit from having a smooth teleport I'd rather even have some in-between frames than not having a smooth teleport.

migrated

Yes, that's the bug report. Current teleports are not smooth. i.e. the player can see a flash of movement while moving.

migrated

That's minecraft is "smoothing" the movement between the start and end, for an instantanious teleport, you need no smoothing (no frames in-between teleports)

migrated

Still an issue in16w02a.

migrated

Update the issue to 1.8 instead of staying at 1.7.10, then maybe they will see it.

migrated

@unknown:

Affected versions: Minecraft 1.4.5, Snapshot 12w50b, Snapshot 13w10a, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w17a, Snapshot 13w18b, Snapshot 13w18c, Snapshot 13w19a, Snapshot 13w21b, Snapshot 13w26a, Minecraft 1.6.2, Minecraft 14w33c, Minecraft 14w34b, Minecraft 1.8-pre1, Minecraft 1.8-pre3, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1-pre4, Minecraft 1.8.1, Minecraft 1.8.8, Minecraft 15w35e, Minecraft 16w02a

migrated

This is still an issue in 16w05a.

migrated

Still in 16w05b.

migrated

Still an issue in 16w06a.

migrated

This seems to still be an issue in 16w07a.

migrated

Sort of fixed in Minecraft 1.9 pre-release 2

migrated

In what way? Do we keep this ticket open?

migrated

Most of the time you don't see the glitch. But sometimes you see it very clearly.

migrated

Still in Minecraft 1.9 pre-release 3

migrated

This is still an issue in 1.9 pre-release 4.

migrated

This seems to be fixed in 1.9.1 pre-release 3! There is no longer a flash on the screen, and it only very rarely jitters if you're moving swiftly.

migrated

Anybody still able to reproduce?

migrated

I'm still able to reproduce in 1.9.1-pre3

migrated

Isn't the fix so simple as setting player's lastPosX = teleportX etc. to prevent animation when packet arrives?
This change shouldn't break any entity trackers, I hope.

migrated

Confirmed for 1.9.2 and 1.9.3-pre1

migrated

Confirmed for 1.9.3-pre2

migrated

Confirmed for 1.9.4

migrated

Confirmed for 1.10-pre1

migrated

Confirmed for 1.10

md_5

Can someone please attach a world that shows this bug.

Thanks

migrated

As requested by md_5, a world which illustrates the difference between absolute teleports and relative teleports.

Easy way to tell the difference between the two types in the current version of MC is to be jumping as you click the buttons.

migrated

Here's the world I always use to test if the bug still exists. (

[media]

)

FaRo1

Doesn't this work as intended? If you, for example, make a repeating command block to teleport an armor stand 0.1 blocks in every tick into one direction, it looks really smooth because of the movement between the game ticks. Movement that gets controlled by the server and teleportation (also by the server) are the same for the client. If you for example have internet lag on a server and a player seemingly stands still for a while, you can then see the direction he went when you get the next positional data instead of the other player just disappearing.

migrated

Hmm, even if that is how it's supposed to be working then it still wouldn't be working as intended since sometimes it does generate extra frames in between and sometimes it doesn't.

FaRo1

That could be client lag.

migrated

Even when the client constantly has 60 fps this issue sometimes does, and sometimes doesn't happen. You'd expect to either see 2 blended frames (since the server runs on 20 ticks per second) or no blended frames at all. Right now it's just random.

FaRo1

Ok, could you please update the description if you like and could some mod change him to the reporter then?

migrated

Done.

migrated

Done.

Fefinix

Confirmed for 16w32b.

migrated

Is this still an issue on the latest snapshot 16w44a?

migrated

How many times is this gonna be reopened?
This is never getting fixed is it

migrated

Ben are you experiencing this in the latest version?

migrated

I really hope this gets fixed, this was one of my favorite features before it broke. 😞

Uriel Salischiker

Seems to be happening reliably for me

migrated

Can confirm. I made a lot of short puzzle maps that use relative teleportation, and the flashing really ruins it.
It is inconsistent, so sometimes I'm lucky and it looks smooth, other times I see a flash that completely gives away that you are teleported.
How is this unassigned 😞

yuliang99

Still happening sometimes on 17w06a

migrated

17w13b confirmed

migrated

Still happening in 1.12 (in case someone wants to update the affected versions)

migrated

Bug still relevant and extremely annoying - this needs to get more attention as it ruins many custom maps.

migrated

confirmed for 18w01a

migrated

Something interesting is that clicking escape toggles this effect (sometimes)

FaRo1

Are you sure that you're commenting on the right report? And pressing Escape pauses the game, how does that toggle an in-game behaviour?

migrated

It was probably a coincidence, but it stopped it for a short while sometimes

migrated

Also, confirmed for 18w02a

migrated

Confirmed for 18w03b

lord.quadrato

Confirmed for 18w10d.
Someone please update affected versions.

lord.quadrato

Tested and confirmed for 18w11a, 18w14b and 18w15a.
I would love to see this fixed, especially for the technical side of 1.13 and since this bug is really old (came up in 1.4.5)
Edit: Now also confirmed for 18w16a

Still happens in both *18w19a *and 18w19b

migrated

And 18w20a

Hugman_76

Affects 18w20c

migrated

and 18w21a

migrated

You can also see other teleporting players moving for a few frames. I'm pretty sure this is the same bug

migrated

1.13-pre2 also.

migrated

And 1.13-pre6.

 

Is there any talk of fixing this?

migrated

1.13-pre9

migrated

confirmed for 1.13 release

migrated

Fixed :O
I guess I'll have to make the Code IV now 🤔

migrated

Still getting this in 1.13.2

How??????

pokechu22

18w43a is the first snapshot for 1.14. I've added 1.13.2 to the list since it is still affected, though.

migrated

holy crap, they fixed it!

migrated

migrated

Confirmed

/tp, movement, teleport, visual

Minecraft 1.4.5, Snapshot 12w50b, Snapshot 13w10a, Minecraft 1.5, Snapshot 13w11a, ..., Minecraft 18w32a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2

Minecraft 1.7.10, Minecraft 18w43a

Retrieved