mojira.dev
MC-128441

/tp <target> <destination> uses context dimension rather than destination entity's dimension

The bug

/teleport <targets> <destination> should do the following:

  • Move each of targets to match destination's coordinates.

  • Send each of targets to the dimension in which destination resides.

Here's what it actually does:

  • ✔  Move each of targets to match destination's coordinates.

  • ❌  Send each of targets to the dimension of the current command's context.

How to reproduce

  1. Spawn a marker entity in the spawn chunks: /summon armor_stand

  2. Enter the nether

  3. Run /tp @s @e[type=armor_stand,limit=1]
    → ❌  You remain in the nether, but your coordinates change.

  4. Run /execute in overworld run tp @s @e[type=armor_stand,limit=1]
    → ✔  You are transferred to the overworld and end up near the armor stand. The first command should have done this as well.

Dimension context should be overridden in this case, always using the dimension of the destination entity. For the /teleport overload that uses coordinates, the dimension context should be used (this works now correctly).

Linked issues

Comments 13

I had the same issue for snapshot 18w15a. This seems to be resolved in Minecraft 18w16a.

I would try again OP, and CreeperMagnet!

If that changes again, I'll update here.

It's still present for me in 18w16a. Did you use the command formats I mentioned?

Does this affects 1.13-pre6? If so, update the issue accordingly.

Until this is fixed, you can use this as a simple workaround:

/execute at <entity> run tp <victim> ~ ~ ~

3 more comments

It isn't really teleporting between dimensions if you can't actually teleport between all of them. Perhaps it's just intended for teleporting to players, and not just any target entity, but that limits its use to multiplayer. Perhaps we'll see what the future holds for the new /chunk command, if it stays then there won't be an issue of unloaded entities anymore, and teleporting between dimensions will have a practical use outside of multiplayer. It just seems odd/wrong that they would intend to add the capability, but severely limit it like that, which is why I included the bit on the commands failing in some cases, but now with the /chunk command (if it survives) that part doesn't need to be addressed.

Ticket title covers the fix perfectly - just need to replace usage of the context world with the entity world when calling the teleport method.

This is still broken in 1.13.1.

It broke again somewhere around 1.16.221

(There is no version 1.16.221 of Minecraft: Java Edition.)

Aaron Rhodes

coschevi

Confirmed

Commands

/teleport, /tp

Minecraft 18w15a, Minecraft 18w16a, Minecraft 18w20c, Minecraft 18w22c, Minecraft 1.13-pre1, ..., Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, Minecraft 1.14

Minecraft 1.14.1 Pre-Release 1

Retrieved