Mojira Archive
MC-123364

Player-in-block checking happens after block collision events are done

The bug

The NetHandlerPlayServer.processPlayer (MCP name) function checks if the player's bounding box is intersecting any blocks, and if it is, reverts the player's position to the old one.

However, this check is done even if the player has been teleported by a portal block such as the end portal, which can lead to the following problem:

  1. A player somehow sends a move packet that places them halfway between an end portal block and an end portal frame block
  2. Even though the move is illegal, the end portal's collision function gets called and the player is teleported into the end (Bug 1)
  3. The collision checks whether the player's move was invalid and reverts the player's position, but not dimension change (Bug 2)
  4. The player is dropped into the end at their previous position, likely causing them to fall into the void and die

Doing this check before block collision functions are called (or at least also cancelling the dimension change) would solve the problem.

How to reproduce

  1. Use the following commands to make you intersect with a block and stand in front of an end portal
    /setblock ~2 ~ ~ end_portal
    /setblock ~1 ~ ~1 glass
    /execute align xz run teleport @s ~1.7 ~ ~0.700005 -60 0
    
  2. Walk forward
    You enter the end but at your original position instead of on the platform