mojira.dev
MC-279021

Moving through portals in Spectator mode and changing game mode after moving away teleports the player through

Moving through a nether portal, end portal or end gateway in Spectator mode and switching to a different game mode after moving out of the block acts as if the player is still inside the block and teleports them.

How to reproduce:

  1. Execute one of the following commands:

    /setblock ~ ~ ~2 minecraft:nether_portal
    /setblock ~ ~ ~2 minecraft:end_portal
    /setblock ~ ~ ~2 minecraft:end_gateway{exit_portal:[I;0,0,0]}
  2. Switch to Spectator mode.

  3. Fly through the block you placed.

  4. Switch to Adventure, Creative or Survival mode.
    → ❌ You are teleported as if you were still inside the portal/gateway.

Expected result:

The player would not be teleported through a portal or gateway when not inside it.

Observed result:

The player is teleported through a portal or gateway when not inside it by moving through it in Spectator mode and switching to another game mode.

Linked issues

MC-279428 Spectating through portals then switching gamemodes will teleport player Resolved MC-279513 Touching an end portal while in spectator mode teleports the player when they exit spectator mode Resolved MC-279528 Going through nether portals in spectator mode, then switching to another mode causes you to go through the nether portal, even if you aren't touching one Resolved MC-279952 Touching a portal while in spectator mode causes the player to teleport when they leave spectator mode Resolved MC-280039 nether/end portal spectator glitch Resolved

Attachments

Comments 6

This bug also creates hug server lagspikes after switching the gamemode to smth else than spectator.

@unknown, the report is already set to "Community Consensus", and 1.21.4 is already marked as affected. There is no need for another confirmation.

I had the same thing I went into spectator fly through the end portal moved out and changed back into creative mode and I got teleported to the end this is a strange bug

Cannot reproduce in 25w10a.

[Mod] ManosSef

(Unassigned)

Community Consensus

Platform

Normal

Collision, Player

24w45a, 1.21.4, 25w02a, 25w03a, 25w05a, 25w06a

Retrieved