Hi it’s me waffles and i think you can tell what this is behind me you can probably tell where i’m going with this but this is a video on how to make custom portals since i reached 1 000 subscribers and people have been asking this for so long i thought i’d make a Video on this but you will probably see why i hadn’t made one on it before of course i don’t go over every possible thing you can do with portals in this video because that would take forever and also portals are completely custom you’d have to make them yourself but if You guys want videos on more specific things about portals then you can tell me those in the comments and i’ll make one about that in the future of course before i start the video i will show you that in fact this portal actually does work because i’m not going To clickbait you or anything i can walk into it and it’ll take me to the ether and of course this doesn’t look like um the either from the aether mod this is just a placeholder you can see that it is in fact a custom dimension in the top Left so you can make this anything you want if i put a pic in the portal it goes to another dimension and if i go through the portal you can see that there is a pic here that’s the second one it’s sent through you didn’t see the first one Anyways this is my custom portal system so keep watching if you want to learn how custom portals work so one thing that i’m going to need to make clear before starting this video is that this video is aimed at people who already have at least a bit of an Understanding of how uh function data packs work for instance you’re going to need to know the stuff impact.mc meta and that will be linked in an icard up here if you don’t and you’re also going to need to know how to create functions and i do have a video on that which i Will also probably link in an icard if you don’t know how to do that yet so you will notice that i actually have three namespaces the first is the aethername space and this just includes a custom dimension called the aether that’s because the portal that i’m using as an Example is the same as the aether portal from the famous aether mod and this is just going to be the dimension that the portal is leading to if you don’t know how to make dimension stuff then i’m not really sure why you’re here because this is for the custom dimension that you’ve Probably already made but you don’t know how to do that yet then i will link uh an icard to the playlist so anyways i’m not going to be going over the eighth dimension especially because it’s just a copy of the overworld what we’re all here for is the functions part so what I’m going to be doing in this video is a bit different from what i usually do usually what i do is i tell you exactly how to do something and you can follow along with exactly what i’m doing but instead in this video i’m just going to be showing you how my Pack works the one that i’ve made and you can either copy me because there’s a download in the description as usual or you can make your own pack that uses the same kinds of ideas as this pack uses which is what i would recommend because i don’t claim to be the most expert Function maker ever so this pack could be perfect or there could be some changes that you would like to make so getting onto the actual functions of course in the minecraft namespace i just have a folder called tags and then functions and then i have load and tick Dot json and both of these are running the functions in my wab portals namespace load and tick as it says right here before i actually go into those functions i’m going to talk about the predicates and tags so the first predicate is the dimensions predicates And i’ve gone ahead and made one for all three of the vanilla dimensions and one for my custom dimension of course you’re only going to make your portal go between two dimensions because otherwise that would get confusing kind of like how nether portals can only be built in The overworld or another but not the end so you only really need the predicate for whichever dimensions you are using but as you can see it’s just a simple location check and then a dimension and i will have the code for this in a paste bin in the description and so that’s Just going to make it so you can tell which entities are in which dimensions and that’s going to be really useful later on then there’s also travelers and this predicate is all mobs it excludes all of the entities that you probably don’t want going through your portals so Those are projectiles and then things like withers and ender dragons another thing it does this is something that i worked in because i’m planning on using this kind of data pack for my war dimension on the waffles smp is a way to block specific entities from going Through the portals and of course um you don’t need to use this i just felt like i should maybe include it but anyways all of this code will also be in the pastebin and the pack download in the description however it’s also a pretty simple predicate i just have a bunch of Sections excluding specific entities from going through the portal so that seems pretty complicated but all it is is checking which dimension something is in and then checking if it’s allowed to go through the portal you won’t need to change anything there except for this file you will need to rename it to The name of your dimension so for example if my dimension was called waffle i would rename it waffle and you would have to change the name of the dimension in here so that’s all you’re going to need to change there however moving on to the tags section i have Tags and then blocks and then air.json and this is basically just all types of air in the game i also have three folders activation frame and portal and each of those inside has a file named after my dimension so you will need to change the name of that File to match the name of your dimension and you can also create multiple files if you want to make multiple kinds of portals so this is just going to be the block that is used to activate the portal so since my portal uses water to activate it it’s water And the nether portal uses fire to activate it so that would be fire um you can make this any kind of block you want the frame is what the frame is allowed to be made of so mine is glowstone but if you want to add more possible blocks then you can just Add a comma and a new kind of block so say you want to make it stone you could do that and that just means that a player will be able to build a frame out of multiple kinds of blocks and then lastly is the portal one and this is the blocks that actually Make up the inside of your portal so you can either leave this as air or you can make it moving pistons like i did and if it is moving pistons that means nobody can place a block inside of the portal so it looks like air but you can’t Break or modify the blocks inside which kind of makes it act like another portal because you can’t place blocks within the nether portal frame while it’s activated so again that may seem complicated but it makes it a lot easier later on and all you have to do is create a Folder for those blocks so now that you have seen the predicates in the tags that the functions need in order to work i’m just going to go over the functions that i created in this data pack so of course in functions there’s going to be Load and tick so load creates a bunch of scoreboards that you’re going to need and each of these scoreboards is described by the line above it so this scoreboard scoreboard objectives add either portal activation check used water bucket is just to check if i have used the activation block that is needed To open the portal so you can change this to whatever your activation block is and change either in the name to whatever the name of your dimension is and then all of these ones don’t need to be modified there is the player reach range and this is used in raycasting Basically you’re trying to find the block at which this item was placed and at that block you’re going to create a portal this wa portals timer is not actually used in any of the functions but i’ll show you a way that you can use it because it could be helpful Wwe portals cooldown here is just setting a cooldown for using the portal because if there was no cooldown it would just immediately teleport you back and forth through both dimensions so this way it makes it so it’s i think 15 seconds before you can be teleported Back to the other dimension by a portal so then in tick what it does is it sets the player’s reach range to 13 and that is just for this function right here the locate block function which i will show you in a second you need it to be 13 Because by testing that seems to be about the right amount of times that the raycast function will will need to work in order to test all of the blocks that the player could have placed the block at and then this immediately after it does the rig cast sets the aether portal Activation check to zero and what that’s going to do is if this raycast is complete and it turns out that you did not actually put a block in the right place to create a portal it will just reset that so that way it doesn’t get confused later on then right here this function Waffles are better portals run main ailer that is just to keep this nice and tidy so you can just copy this if you want and paste it again and that and then change this to name of a different dimension and that way you can have multiple commands for multiple Portals run at the same time without cluttering up this file and then this last part here is the cooldown execute as something that can travel through the portal unless their score equals their score so basically uh if they don’t have a score because if they don’t have a Score then their score can’t equal itself then it will set their cooldown to zero so that’s basically just making sure that the player has a cooldown score and if they don’t have a cooldown score uh it will make them have one then this last part down here execute as that Player if their cooldown is greater than one and if they are not standing in a portal it will then remove one point from their cooldown and i will show you again once we get to that part how the cooldown is actually set up so you can see what it really does And this timer as i said is not used it’s just a way to set up a timer in order to make it so commands don’t all run at the exact same time because that might cause a bit of extra lag and so if you want to optimize the pack you can use this And to do that you’re just going to have to add function uav portals timer and that will run this and then you can use stuff in here to run the code at different times and i will have a link up here to a video where i talked about how to use timers Now it’s time to get into how the portal actually works so the first thing i’m going to go over is this code right here the locate block either so i’m going to go into activate right here and then locate block either so again this will just be named Whatever your dimension is what this is doing is it is removing one reach range every time it does the command and then if your reach range is still greater than one and the block where you are is air as defined in this tag here it will Run the same function again half a block in front of where you’re looking so if i go back to the tick you’ll see that at the beginning it sets the range to 13. since it has a range of 13 it will do this 13 times before it runs out so this is Just going to test every block directly in front of where you’re looking 13 times moving forward a little bit each time and then each time it moves forward it is going to run this detection thing here to detect if the block where it is positioned is the activation ether block And that was in tags here the activation block is water and since this is triggered whenever you place a water block it’s just trying to find where that water block is and so if that block is water and if the block below it is part of the aether portal frame which is Also specified in the tags here it will then run this function so if the block is water and the block below that is the ether portal frame that means it might be placed on the bottom of the frame and so it’s then going to run this function To check whether there is a complete frame there if the block is water and it is two blocks above a valid block of the either portal frame it’s then going to run this function to test whether it is in the middle of a frame and if it is three blocks above then That means it might be at the top of the frame so it’s going to do the same thing so basically what all this is doing is trying to find the activation block and if the activation block is there it then goes ahead and looks for a frame so when It’s looking for a frame it’s then going to go to the check frame folder and here you can have a different folder for each portal you want to make looking at bottom.nc function all it is going to do is check every single block where the frame needs to be and this is for Another portal-shaped frame which is the same as an either portal-shaped frame all it’s doing is checking every single block of the frame to see if it is from this frame either tag it is also checking the inside of the frame to make sure that it’s in the air tag so that’s Just making sure that the frame is complete and it is also empty so if all those blocks are in the correct place it’s then going to run the relevant activation function and this is testing every possible orientation because you could build a frame that is along the X-axis or along the z-axis so basically it’s just going to check every possible way you could have built a frame and then uh the mid and top functions are the same except of course moved up one block and two blocks respectively because you don’t always have to place The activation block on the very bottom of the frame so as you can see if i go all the way over here run one of two creation functions at the right place so if the portal frame is along the z axis it is then going to run this z-axis Function to create a portal along the z-axis and if it’s along the x-axis it’s going to do the same thing with the x-axis and this part right here determines where exactly it needs to do that if you place the activation block on the north side of the portal it’s just going to Run the function as normal but if you place it on the south side of the portal it’s then going to move the position one block over and do this same function and you’ll notice that it’s doing that exact same thing here except it’s also moving it down one block and the same thing Uh here except it is also moving it down two blocks so that way wherever you put the activation block in the frame it will end up doing the exact same function in the exact same place now if we go on to what that function actually Is it is activate create either z so if i close this and go to activate create ether z we’ll see what it’s actually doing so it is filling the inside of the frame with moving pistons and that is going to make it so nobody can place any blocks inside of the frame because Moving pistons are invisible and you can walk through them but you can’t uh place any blocks so it fills the entire inside with moving pistons and then it is going to summon an armor stand inside of every block in the frame and those armor stands are both going to Uh be detecting if there is an entity there that they need to teleport as well as holding a custom item on their head that has the texture of the portal itself so the armor items part over here is optional because you don’t need to have the custom portal blocks thing However you are going to need to summon the armor stands because they’re what checks if a player needs to teleport then this section here uh is summoning a marker and this marker is going to sit in the frame and do everything that the portal does it’s going to be actually Teleporting player it’s going to create portals in the other dimension if someone needs to teleport to the other dimension and it is also going to be checking if the portal is broken so this marker is the most important thing in the function and then this is an Optional part it’s going to play a specific noise when the portal opens i’ve just made that the end portal opening sound so this is the create z function but there’s also the create x function which as you can see is exactly the same except with different coordinates because it’s creating a Portal that’s aligned along the x-axis instead of along the z-axis so all of that is how the portal actually gets activated but we haven’t even gotten to the part about how the portal works but thankfully that’s a little bit simpler if you go to the tick function you’ll See that after all of that stuff that i just showed you it’s then going to run the function wab portals run main either so if i go to run i can then go to main and either and this is going to control everything that the portal itself does So here it’s going to execute as a portal stand which is the armor stands that it created over here in the create functions executing as those in the overworld so any portal that has been created in the overworld at s if there is a valid traveling entity Um within half a block of that portal that has a cooldown of zero it will then find the portal marker that is within the portal that i was just talking about a minute ago and then go to the aether and force load that position basically all that’s doing is If there is a player standing within a portal the marker of that portal is going to load the other dimension and this line underneath it does the exact same thing except for the second dimension this line up here is for detecting if there’s a player who wants to teleport from the Over world to the other dimension and this line right here is for detecting if there’s a player that wants to teleport from that dimension back to the overworld so then this line down here the first part of it is doing the same thing is up there you’ll see that the Code is exactly the same if you look at these two lines uh it’s doing the exact same thing it is finding the marker of the portal but the player wants to teleport from and then checking in the other dimension if there is a portal that is available to teleport to so Uh in the aether if there is an entity which is a marker and has the tag either marker uh and is in the aether then it is going to select that person who wants to travel so as at e predicate equals travelers all mobs and then run the teleport either Dimension one command and then this line below is doing the exact same thing but for people that want to teleport from the aether to the overworld so if i go to teleport either dimension one all that is doing is executing in the aether at the right portal uh teleport to that Location and then it is setting the cooldown which means you can’t immediately be teleported back and the cooldown is 300 because that is 15 seconds then all it’s doing after that is getting rid of any force loaded chunks because that will help clear up any lag then of course dimension 2 is Doing the same thing except teleporting to the overworld back to the main ether function there might not actually be a portal in that location so again this is the exact same code mostly as these two above it actually the exact same as the line above except instead of checking if There is a portal in the other dimension it’s checking if there is not a portal in the other dimension and so if there is not a portal in the other dimension it is going to find the marker that belongs to the portal that the player that wants to be teleported is standing In and then it is going to run the function create alternate either dimension 1 which is just going to create a portal in the other dimension and then this line down here is the exact same except that it is for if people want to teleport from the other dimension back to the Overworld it will create a portal in the overworld again if i go to the create alternate folder you can see that this is basically exactly the same thing as where is it the create file except instead of just making moving pistons it is also going to place the portal frame Block because it needs to create the frame and stuff inside and then it’s going to do the same thing with the armor stains that i talked about earlier and it’s going to summon the marker that i talked about earlier and it is going to play the opening portal sound and Then lastly it’s also going to remove the force load that was created because as i said that will remove unnecessary lag then of course the dimension two one is the exact same thing except it’s for creating a portal in the overworld from the aether and finally the last function Is going to be running the check if broken function by portals along the z-axis and portals along the x-axis so if i go to the check if broken folder you will see that basically what it’s doing is checking if all of the blocks in the frame are there And if they are all there it adds the tag unbroken and then if it is not unbroken it will then kill all of the portal stands and if it is not unbroken it will get rid of all of the moving pistons but again if you used air instead of moving Pistons this is optional if it is not unbroken it will play a breaking sound at the location of all of the armor stands that it destroyed and that is optional you don’t have to have a breaking sound then lastly if it is broken it will kill the portal stand Which as i said before is the most important part of the portal so if there is no portal stand the portal itself cannot function and then at the end of the function it removes the unbroken tag so it can do this whole searching thing in the next tick so if this seems too Complicated to you and you don’t want to make your own version then you can use my version so you would have to change this the name of the functions and the name of the folders so every folder that has the word either in it would have to be changed to the Name of your dimension and and same with all of the tags like aether.json here and same with the predicate.json and then you would just need to go into all of the predicates and all of the functions and all of the tags and just replace the word either with the name of your dimension So if i go to run and either to mc function i could do control h and just type in either here and replace it with waffle because maybe my dimension is named waffle so if i replace every instance of the word aether with waffle and replace all then This will work for a dimension named waffle although you will need to keep in mind that if it is doing it in a specific dimension let me see like right here if it says in the dimension you’re then going to need to probably change the first word unless Your name space is also waffle and your dimension is called waffle and then the only other thing that you’re going to need to change is in create alternate you’re going to need to change the name of this block to the name of the block that you want the alternate portal to be Made of so the way i set this all up it’s meant to be easily customizable and the way i’ve set it up in folders you can even make this work for several dimensions at once so say you want to have portals to like four other dimensions you could just copy the Folder named aether and switch its name to waffle or whatever and then change the word either within the files within that folder to the word waffle as an example and so that way you could have two different portals next to each other that go to two different dimensions so As you can see what i have done here is i’ve created four different frames that can have four different orientations so if i get myself some water most people who play minecraft are probably familiar with the aether mod basically it creates another dimension called the aether and you can teleport there by Creating basically a nether portal out of glowstone and igniting it with water instead of flint and steel so i’ve created the four different orientations that this works for of course you can make your portal shaped a different way if you modify my code but anyways if i right click with Water as you can see it plays a really loud activation noise let me turn that down anyways it plays a really loud activation noise and then creates this portal and so if i go into spectator mode you can kind of see that there are armor stands if i go ahead and turn off My resource pack you will see that this is actually re-textured snowballs on the heads of armor stands so let me turn that back on also there will be a download to that resource pack in the description if you would like to get the models and textures and modify them to Be the color that you would like or have a different texture or something basically it is exactly the same as the nether portal texture except it is blue and it swirls in a different direction so let me just take another portal yeah see it’s the same texture but they swirl A different direction and it’s blue instead of purple so if you listen to the nether portal being broken it sounds the same as when i break the other portal and as you can see as i said earlier uh i am right-clicking right now i’m right-clicking and uh as hard as i try i Cannot place a block inside of this frame however i can walk and stand inside of the frame if i walk and stand inside of the frame and then wait for a second it should automatically teleport me to the other dimension And that took one second i lacked a little bit i think but as you can see it has created this portal and i’m now in the other dimension even though it looks like the overworld if i press f3 you can see in the top left that my dimension is either either and then If i do slash scoreboard players list walk with their better you can see that i don’t have a cooldown anymore but uh i should be faster with that next time let me so if i go ahead and just go back through the portal um you will see if i Do the command again that i have a cooldown of 228 and that keeps going down until it eventually reaches zero and while that is going down i can’t go through the portal but uh yeah see it’s seven now so i should now be able to go through the Portal sometimes it lags a tiny bit um but eventually it will work there we go but anyways that is all for this video if you have any questions about anything that i covered in this video or as i said in the beginning if you have any Other things you want me to go over then you can ask me in the comments or join my discord server which is linked in the description remember there should be a pack download in the description so that might be able to help you out thank you guys so much for a thousand Subscribers i’ve made a separate video on my channel just to thank you guys for a thousand subscribers so if you want to be thanked you can check that out and thank you so much for watching You Video Information
This video, titled ‘How To Make CUSTOM PORTALS In Minecraft!’, was uploaded by WafflesAreBetter on 2022-02-19 20:00:03. It has garnered 8894 views and 274 likes. The duration of the video is 00:27:21 or 1641 seconds.
In this video I talk about how you can create custom portals that lead to custom dimensions using a data pack! If you find this helpful, consider subscribing to see more tutorials like this!
Thanks for 1000 subscribers!
MUSIC IN THIS VIDEO:
Artist: C418 Support him here: http://c418.bandcamp.com/
Album: Minecraft Volume Alpha Title: 19 Cat
Album: Minecraft Volume Beta Titles: 20 Chirp; 21 Wait; 23 Stal; 24 Strad; 27 Mall; 28 Blocks; 29 Far; 2 Alpha
THIS SERIES:
Worldgen playlist: https://www.youtube.com/watch?v=LcfnicnnRuU&list=PLLMXBYd7a-yfr2e0kvl33O-pH6eS8V626&index=1&t=0s
LINKS: My Discord server: https://discord.gg/JrPaEkjuQP Patreon: https://www.patreon.com/wafflesarebetter
Download the pack (click to instantly download): https://github.com/WafflesAreBetterMinecraft/Portal-development/blob/main/Main%20Portal%20Development.zip?raw=true
Download the portal block resource pack (click to instantly download): https://github.com/WafflesAreBetterMinecraft/Portal-block-resource-pack/blob/main/Portal%20block%20thing.zip?raw=true
(All of the code in the pastebins below are included in the pack download) Pastebin for pack.mcmeta: https://pastebin.com/ZVV965A7 Pastebin for dimension predicate: https://pastebin.com/iKyftu8Q Pastebin for traveler predicate: https://pastebin.com/UF5qvsTZ
Get Visual Studio Code: https://code.visualstudio.com/
TIMESTAMPS:
0:00 – Intro and sponsorship (Thanks Server.pro!) 1:12 – Explanation thing 3:10 – Predicates and tags 6:57 – Load and tick functions 10:39 – Activating portals 16:40 – Teleportation and stuff 20:44 – Breaking portals 21:50 – Modifying it for yourself 23:44 – Very short demonstration 26:26 – Outro and end screen