Minecraft wiki entry for Ruined_Portal, associated text: Ruined portals that generate underground do so at Y-level from 15 to n−n2, where n is the highest block at the point of generation and n2 is the height of the ruined portal structure. This means the terrain is always higher than or level with the top of the structure. Some ruined portal variants are short enough to generate completely on the surface.