Mineuniverse
Log in Register
Plugins

KPortalToPortal

Allows you to return through the same Nether portal you used the first time.
by _ForgeUser8030194
Download Claim this project
2,166 downloads
0 likes
Updated Jun 30, 2026
0 hypes
Mechanics Teleportation

KPortalToPortal

Have you ever went through a Nether portal only to find when you return from the Nether that you end up in someone's house? The default game mechanic does not always bring you back through the portal you used. This plugin will force you to return to the portal that you originally walked through.

How Does It Work?

Lets say you build a Nether portal and you walk through it. This will create a entry in your history file that holds the source location and the destination location. So if you ever enter a portal that matches the destination location you will be teleported to the source location. This overrides the default game mechanic because you may not come back out the same portal you walked into. This history also covers multiple portals. So that each time you portal a history entry is created. Each time you walk back in a portal that you came out of all history entries below that will be dropped. Also, if you walk into a portal you walked into before all history entries after that entry will be dropped. This helps to keep the portal history files from growing and growing because of teleport such as /tpa and other teleports.

Shortcomings

After a very very very long period of time a player's teleport history files may become slightly large. This can be fixed simply by deleting the files thus erasing the player's history. Do not worry though as this will take quite a bit of time to actually happen. Also each player has two files created which take a minimum of 8KB on most systems just for the two file allocations. However, the files will not actually grow until they exceeds 4KB.

I hope to one day eliminate the file per player and use a more complex format, but at the moment this is one of the best ways to keep the code simple and ensure that if a server crash does happen that the players can be fairly well assured that their portal history was saved.

The code actually checks locations using a 30 block spherical radius. This means that two portals next to each other will likely be considered the same portal. But, this is not a major problem or a problem at all for most players.

But, most servers have quite a large amount of disk space so do not be afraid. I may add in the ability for it to automatically delete a player's portal history after they have been inactive for quite some time and it could do this in the background with out effecting performance. Or, I may devise a better way to keep the portal history from growing and growing over a long period of time by possibly being able to detect if the portal even still exists.

Source Code

The source code is contained in the JAR that you download. Just extract the JAR using a unzip utility. You are free to change, modify, or release the code as your own plugin. Or, if you like you can submit a patch to me and I can apply it, credit your name, and upload the new version.

1.0.1B
MC CB 1.4.2-R0.2
Release 2012-11-11 Get

More from _ForgeUser8030194

KFactions
81,391
KRandomTeleport
5,736
KLandHealer
4,189
KQuest
3,138

You Might Also Like

MobHealth
Simple plugin to let you know the damage you just caused to a mob, and how much health it has left.
989,881
Player Heads
Lop off Player and all Mob Heads with configurable drop rates + pvp-farming nerf, includes detailed commands and permissions
979,351
Advanced Item Effects
Adds custom effects to any item including potion effects.
97,290
VoxelMore
"Sharing is caring."
9,999
SunSteel
A Golden Item Enhancement Plugin
9,880
Sneaker
Hide name tags above players' heads.
9,865