Minecraft wiki entry for End_gateway, associated text: The position where the player or entity lands after teleporting is determined by a systematic algorithm: the gateway searches for a full block (which isn't bedrock), starting from the north-west corner at the topmost height (Y=255) within a 5 block radius around the gateway block (shown as the gold block in the image on the right). If there is a block at that position, then the entity is teleported onto that block. If there is no block, then the next position along the Z-axis is searched (shown as the lapis lazuli block in the image on the right). This continues along each column in an 11 × 11 area at the same Y-level with the exception of blocks above, below, or directly adjacent (including diagonals) to the gateway block. If there are no blocks, it moves one Y-level down and repeats the sequence from the north-west corner again. It continues doing this until every height is checked, and if there are no blocks within any of these points it always teleports the entity exactly two blocks above the gateway block.