3D Nether Portal Linker & Two-Portal Collision Simulator
Portal A (Primary Base / Farm Portal)
The 3D Euclidean Distance Equation Behind Portal Linking
Whenever an entity steps into a Nether portal at coordinates (X, Y, Z), Minecraft does not remember which portal created which frame. Every single transit runs a live spatial search from scratch:
- Horizontal Coordinate Scaling: Overworld-to-Nether scales horizontally as
X_target = floor(X / 8)andZ_target = floor(Z / 8). Nether-to-Overworld scales asX_target = X × 8andZ_target = Z × 8. Crucially,Y_target = Y(1:1, never divided by 8!). - Horizontal Bounding-Box Scan: In Java Edition, the game scans all active
nether_portalblocks within±16blocks horizontally in the Nether (33 × 33column across full build height) or±128blocks horizontally in the Overworld (257 × 257column across full world height-64to319). - 3D Straight-Line Tie-Breaker: Among all candidate portal blocks found inside that horizontal square, Minecraft selects the single block minimizing 3D Euclidean distance:
d = √( (X_portal - X_ideal)² + (Y_portal - Y_ideal)² + (Z_portal - Z_ideal)² )
Because ΔY is unscaled while Overworld ΔX and ΔZ are compressed 8:1 into the Nether, a 60-block vertical mistake outweighs a 450-block Overworld horizontal separation!
Read our complete step-by-step geometric proof with worked Nether-roof farm examples in Why Nether Portals Link to the Wrong Spot: 3D Euclidean Distance Proof.
Portal Search Window & Minimum Separation Reference
| Travel Direction | Coordinate Transform | Horizontal Search Window (Java) | Safe Zero-Interference Separation |
|---|---|---|---|
| Overworld → Nether | (⌊X/8⌋, Y, ⌊Z/8⌋) |
±16 Nether blocks (X & Z), full Y |
> 128 Overworld blocks, OR exact matching (X, Y, Z) pairs |
| Nether → Overworld | (X × 8, Y, Z × 8) |
±128 Overworld blocks (X & Z), full Y |
> 16 Nether blocks, OR exact matching (X, Y, Z) pairs |
Java Edition vs. Bedrock Edition Portal Mechanics
Java Edition (1.21.4)
Portals built above the Nether bedrock ceiling (Y = 128–255) are scanned and valid destinations! Overworld portals at high sky farms (Y = 200) link cleanly to Nether-roof hubs without needing bedrock breaking.
Bedrock Edition (1.21.50)
Hard build limit in the Nether is Y = 127 (cannot build on the Nether roof), and Overworld deep-slate portals down at Y = -54 clamp upward to Y ≥ 5 on the Nether side—so always clamp negative Y portals to Y = 10–15 in Bedrock Nether tunnels.