Step 14: Portals
The AdvancedPortals mod is a great way to link locations and worlds together so that players don't spend too much time traveling to the areas they need. It also fully supports pEX so that you can limit access to areas for some or all players, such as a portal directly to a town that only town members can use.
Advanced portals works similarly to WorldEdit and Worldguard, but it will have its own selector item which is by default and iron axe. You'll use this tool to select an area, then issue the commands to set the portal as either an entrance or exit, and then if desired fill in the area with the portals fluid type.
Before we make our first portal though lets take a look at the configuration file and make a few changes so that it works better with our server.
Advanced portals works similarly to WorldEdit and Worldguard, but it will have its own selector item which is by default and iron axe. You'll use this tool to select an area, then issue the commands to set the portal as either an entrance or exit, and then if desired fill in the area with the portals fluid type.
Before we make our first portal though lets take a look at the configuration file and make a few changes so that it works better with our server.
config.yml settings
What we have changed is the Protection for portals being enabled, this is because we already have mods to handle protection, and mixing more into the server will generally cause you nothing but headaches. Everything else is fine to leave alone unless you have a specific reason to change things. Now that the configuration is fixed, restart your server and lets build our first portal.
Creating Portals
the first thing to do is make a structure that a player can walk into or jump into, as portals can be completely 3D in shape, though be aware that horizontal pool portals might need to have the PortalCooldown setting increased to 15-30 seconds so that players that fall in but don't have permission don't cause a ton of permissions failure messages. For my tutorial I'll just create a vertical ring that is 4x4 with the center 2x2 blocks being left empty.
Now I need to summon the selector tool for the portal plugin by typing the following:
"/portal selector"
Which will tell me that I've been given the portal tool and if I have room in my inventory a special Iron axe will appear. Select the iron axe as your item in hand and left click the top left corner of the ring, and then right click the bottom right corner of the ring. You now have your area selected for the portal.
The portal create command has quite a few options to set, and unfortunantly the in game command line has a small limitation of how much you can type. Luckily after a portal is created, you can stop the server and manually adjust settings in the portals.yml file if needed. I generally just try to shorten names as much as possible to avoid that. But lets look at the command and what options we can set.
"/portal create name:<name of portal> desti:<Destination> triggerblock:<AIR, WATER, LAVA> permission:<custom permission we'll use in pex>"
The Name and Destination are simple enough, and you can target multiple portals to a single destination to create a kind of Hub area as you'll see in the video. triggerblock determine what kind of block the player much touch inside the selected region to trigger the teleport, it needs to be a block a player can be inside of like air and liquids. permission is going to be the string we'll put into pEX to determine if a player should or shouldn't be allowed to use the teleporter. I generally use the following setup of portal.<worldname>.<destinationname> and often I have to go and manually edit that into the file due to command length issues. But it makes it easier to read later when you're trying to get things working across 15-20 teleports.
So here's the command I used to create the portal in my creative world to my main world hub.
"/portal create name:Creat2Hub desti:Hub triggerblock:WATER permission:portal.world.hub"
It should say it was successful and show you the correct information for each setting. Now we can fill in the 2x2 area with Water and it will not leak out. But when you try to jump through, nothing will happen. This is because we haven't created the destination yet. Lets teleport to our main world now and build a quick little destination platform. I usually do a 3x3 horizontal structure with a colored glass block in the middle.
Once you're standing on top of the glass block, issue the following command to create our destination.
"/destination create Hub"
Now go back to the creative world and give it a try. You should be able to jump into the water and be teleported directly to the other worlds platform we set as the destination with a little sound effect and particle explosion.
Besides using portals just to get between worlds, also consider that you can set them up for mazes, traps, and even race checkpoints. I suggest making a cool looking portal building that you'll use for inter-world movement, and then a seperate portal style for locations within the same world, so students are better able to understand what they are going. A centralized hub is also a good idea in your main area for everyone to arrive in and leave through.
Now I need to summon the selector tool for the portal plugin by typing the following:
"/portal selector"
Which will tell me that I've been given the portal tool and if I have room in my inventory a special Iron axe will appear. Select the iron axe as your item in hand and left click the top left corner of the ring, and then right click the bottom right corner of the ring. You now have your area selected for the portal.
The portal create command has quite a few options to set, and unfortunantly the in game command line has a small limitation of how much you can type. Luckily after a portal is created, you can stop the server and manually adjust settings in the portals.yml file if needed. I generally just try to shorten names as much as possible to avoid that. But lets look at the command and what options we can set.
"/portal create name:<name of portal> desti:<Destination> triggerblock:<AIR, WATER, LAVA> permission:<custom permission we'll use in pex>"
The Name and Destination are simple enough, and you can target multiple portals to a single destination to create a kind of Hub area as you'll see in the video. triggerblock determine what kind of block the player much touch inside the selected region to trigger the teleport, it needs to be a block a player can be inside of like air and liquids. permission is going to be the string we'll put into pEX to determine if a player should or shouldn't be allowed to use the teleporter. I generally use the following setup of portal.<worldname>.<destinationname> and often I have to go and manually edit that into the file due to command length issues. But it makes it easier to read later when you're trying to get things working across 15-20 teleports.
So here's the command I used to create the portal in my creative world to my main world hub.
"/portal create name:Creat2Hub desti:Hub triggerblock:WATER permission:portal.world.hub"
It should say it was successful and show you the correct information for each setting. Now we can fill in the 2x2 area with Water and it will not leak out. But when you try to jump through, nothing will happen. This is because we haven't created the destination yet. Lets teleport to our main world now and build a quick little destination platform. I usually do a 3x3 horizontal structure with a colored glass block in the middle.
Once you're standing on top of the glass block, issue the following command to create our destination.
"/destination create Hub"
Now go back to the creative world and give it a try. You should be able to jump into the water and be teleported directly to the other worlds platform we set as the destination with a little sound effect and particle explosion.
Besides using portals just to get between worlds, also consider that you can set them up for mazes, traps, and even race checkpoints. I suggest making a cool looking portal building that you'll use for inter-world movement, and then a seperate portal style for locations within the same world, so students are better able to understand what they are going. A centralized hub is also a good idea in your main area for everyone to arrive in and leave through.