# Second Nether portal links back to original portal location in the Overworld

I built a Nether portal in a village and one near spawn. The portals are about 5k blocks apart from each other. But if I go through to village portal, it takes me back to the main spawn portal instead of creating another one in the nether.

I understand how portal linking works, I calculated the distance, and instead of the portal taking me into the exact same spot in the Overworld that I calculated, it just takes me back to the spawn portal.

This server has no plugins. Would a plugin solve this? Or is there another way I can get this to work?

• This has happened to me before. I think this is just a glitch in Minecraft and you have to delete the Nether data folder. Apr 26, 2020 at 17:32

Sorry if you already tried this with

"I then calculate the distance and stuff"

but copy down the coordinates in notepad. divide the coordinates by 8. if you get a number like 37.75 round-up to 38 if you get like 37.25 round down to 37. Go to those coordinates that you divided by 8 in the nether. Build a nether portal. Should build a new nether portal or link to the existing one in the village.

Hope this help out!

• It doesn't even work well in singleplayer, either. I make a portal at 979 ~ 1017 in the overworld, and it takes me to 224 ~ 66, when it should be 122 ~ 127. Apr 27, 2020 at 18:24
• @Xayla Apparently the area where it should spawn the portal is obstructed - bulk of netherrack with no spawning spaces, or a huge void. Break the portal on the Nether side and rebuild two at their proper coordinates. Take the Y coordinate into account too, and try to keep the portals roughly at the correct altitude (doesn't have to be exact but definitely within some ~32 blocks. Also don't divide the Y by 8.)
– SF.
May 24, 2021 at 9:14

There's no way in hell two portals in the overworld 5k blocks apart would link to the same Nether portal. Portal linking works by dividing the overworld x and z coordinates by 8 (and retaining y unchanged), then seeking within 128 block radius from the calculated point for an existing portal. 5000/8=625, so even if the linking was as weak as possible, 128 blocks from the 'exact' position towards the other portal, 625-128-128=369, the absolute minimum between the two portals in the Nether that would result from two overworld portals 5k blocks apart.

If you get sent from the village portal 5k blocks apart, to the Nether portal that generated from the spawn portal, you're facing either some server mods, or a severe bug.

Even then the search for a matching portal within 128 block radius isn't fault-proof. Depending on lag and other random factors, a new portal may generate in case the matching portal is within 128 blocks from the perfect point, but closer to '128' than '0'.