Mojira Archive
MC-121098

Entering a tall portal that takes you to a short portal from the top causes you to take suffocation damage

The bug

When entering a tall portal that takes you to a short portal from the top, you take suffocation damage. This also happens when going from a wide portal to a thin portal.

How to reproduce

  1. Download the attached test world
  2. Enter the portal from the very top platform (you should spawn at it; be careful not to fall down inside the portal)
  3. Observe that when you enter the nether, note blocks triggered by pressure plates on top of the portal play, and you take a few hits of suffocation damage. (Also, you spawn at y=46.71429, while the max y you can fly up to under the portal is 45.2)

Code analysis

By [Mod] redstonehelper, based on 1.12.2 decompiled using MCP 9.40. The problem is that the player's height and width aren't accounted for in net.minecraft.entity.Entity.setPortal(BlockPos) when calculating lastPortalVec. Player height and width then also need to be accounted for in net.minecraft.world.Teleporter.placeInExistingPortal(Entity, float).