Using Portals Support
Introduction
WorldPos v3 introduced portals support (actually it doesn't even have to be a portal, more on this later). WorldPos does not hook into any plugins to do this, instead I used a pretty clever method. In this page I will show you how to take advantage of this feature.
Requirements
- WorldPos installed,
- Multiverse,
- Multiverse portals (most portal plugins will work, I just like this one)
Background Information
Before I explain how to use this feature, I'd like you to know how it works. Knowing how it works allows you to take greater advantage of it. WorldPos knows when you went though a portal by checking the following conditions:
- Did the player change worlds?
- Is the player's Y position 300?
Here's the code for those interested:
wnF = world name from
wnT = world name to
if(Settings.portalSupport) { if(!wnF.equalsIgnoreCase(wnT) && event.getTo().getY()==300) { try { event.setTo(LocationManager.getPastLocation(event.getTo().getWorld(), p)); p.sendMessage(ChatColor.AQUA+"Teleported to world "+ChatColor.YELLOW+wnT+ChatColor.AQUA+" via portal."); } catch (IOException e) { e.printStackTrace(); } return; } }
What happens here is that WorldPos checks if the player changed worlds during the teleport, and if the player's new location has a Y value (height) of 300. If both of those conditions are true, the plugin finds the player's last location in that world and redirects them there. This process is completely transparent to the user.
Note: There is no specific reason for the Y coordinate to be 300, I just decided I would use that number. The Y coordinate of 300 is just a "marker" of sorts.
Tutorial using Multiverse Portals
Read this wiki page first or you will be very confused click here
- Select your portal like normal (using worldedit wand)
- Create the portal using the following command (important!)
replace "newportal" with your portal name (can be anything), replace "foo" with the world name that this portal will lead to
/mvp create newportal e:foo:0,300,0
- You're done!
Now if you walk into the portal it will take you your last location in the world you specified ("foo" in this example)
My player get dropped in the air to their last position in a world, killing them.... Any ideas of what im doing wrong?
@MrCleanIsDirty
Did you enabled portal support on config.yml
hey, i seem to have trouble making a portal to the same destination,,
i made 2 portals from diffrent locations to one and the same world, but with the 3 one it no longer works
@MrCleanIsDirty
in my console it sais it has an invalid destination after creating it<sub> so the portal is created but multiverse does no longer accept the destination</sub>