Hello guys my name is zac nvr and welcome to a data pack tutorial today i will be teaching you how to make custom blocks and so i’ve made these uh very basic looking blocks to show you how this works just show off sort of the properties of These blocks just real quickly so if i go up that’s wrong if i go into say survival mode real quick so you’ve seen they can place and destroy now in survival mode they’ll also drop the item and futures i can deal with that problem he’ll yeah it’ll come up um So yeah now i want to show you i guess how do these blocks actually work and what’s the difference between these two and then we’ll go into how to actually go about making this so of course this uses a resource pack so if i take it off Real quick you’ll be able to see what exactly is going on so as you can see the items are now item frames and the blocks have these like floating item frame things and then you’ve got a couple stone block and a glass block so basically they use custom models so these So you can give items a custom data mbt tag called custom model data and basically when it has that it’ll in your resource pack look for that custom model and it will apply it basically that’s what’s going on it’s oversimplified it a bit but i’ll show you How exactly to make that in a little bit now you can see that these are actually um armor stands and they are wearing the item frames on their head and you can see they’re in slightly different positions um so now what’s the actual differences between the block and why are they the Way they are basically block one allows you to have a universal block so basically the base can be anything is the main advantage of block one oh i’m still in survival and now i’m in spectator um now the problem with this block i’ll show you when i reapply the resource pack Big issue in trying to solve the problems with this block is if i comment here it glows in the dark maybe that’s a cool thing for your block maybe it has a sort of special purpose and needs to glow that’s cool this will be perfect Um the reason it has to glow is because if the armor stands feet are in a solid block so if i place a block above this this would turn like pitch black and we don’t want that um this also tries to solve the same problem so what this does instead is Your base block has to be transparent so that’s why it was gray stained glass before and so it puts the armor stands feet into um that glass block so that the block displays properly um there’s the main differences and so you can decide which one you’re going to Use i’m going to go through how to make both of them they’re slightly different properties in both the data packs and the resource pack so let’s get into how to actually make this in your own world and with your own blocks all right so first we’re gonna look at How to make the resource pack so i’ve opened my resource pack folder um my minecraft profile you can do that through um through minecraft itself if you go into options resource packs and open resource pack folder should lead you to here so i’ve created this folder this is my Resource pack that i’m using custom locks so the first thing you want to do is come in here and you will have to make a file called pact.mcmeta um it looks something like this you have these you can pause it and copy it pack format is 5 as of 1.16 and then the Description you can do whatever you like um so yeah just rewind and pause that if you need to copy that then in assets you will need a folder called minecraft then inside of there you will need two folders one called models uncle textures let’s start with the texture folder Inside textures you’ll need a folder called block and inside here you’ll need your textures for your custom blocks and you can name these whatever you like in fact you technically could name that whatever you like but just stick to block for convenience sake and then we’ll look into models Now inside models you’ll need a folder called item and inside item you’ll need three model files so this first one is item as item frame so what this will do is customize the look of the item frame both on top of the armor stand’s head and in a player’s inventory so This top part isn’t really important it’s just the normal functionality different of the item frame item but this is the important part and so for each of your custom blocks you will need an override thing that looks like this and for each custom model data value and so basically you’ll assign that To block and this file name will need to match the model files here for your custom blocks quickly zach from the future here um this was done wrong this needs a colon just fix that up please and then save so now let’s get into those very model files So that’s gonna open in a new window so block one let’s let’s just put it into this one let’s open them both real quick they’re very very similar but they’ve got a slight difference firstly this is just telling it’s cube if you know what you’re doing you can customize that however you’d like Um the important thing is that this file name specifically this matches the file name of your texture file so back in textures first of all that folder needs to match that which is why i said it was more convenient and then your file name needs to match there And then the display the rotation is zero um the translation is one of the really important things this value needs to be minus 56.03 that precisely makes the block aligned properly and then the scale is 1.60 in all coordinates block 2 is very similar except this translation here is minus 30.43 Okay so that’s pretty much it for the resource pack now let’s move on to the data pack now to create your data pack you’ll need to locate your dot minecraft folder which you can do with the classic percent app data percent if you don’t know and this will take you into your roaming And into dot minecraft here and so to create your data pack you’ll need to create it in saves and then whatever whatever world you’re creating your data pack in i’m actually running minecraft in a slightly different file location so i’ll go to that um so this is my only save so far um So creating the data pack so i have already pre-made the data pack i’m going to drag it in and show you what’s going on boop first you go into the folder and similarly to texture packs you need this pack.mc meta file which is very similar again the pack format is five I’m not sure how it’s gone up that quickly considering data packs have only been around for a few updates but apparently the wiki says it’s five and then you create whatever description you like it’s kind of outdated for this pack but all right so then you’re gonna need two folders One of them is minecraft and then the second one is what’s basically called a namespace so you can call this whatever you like as long as there’s no spaces or there’s a lot of characters that you can’t do so just do lowercase um letters and underscores i think numbers are fine as well But maybe don’t test your luck anyway so we’re first gonna have to go into minecraft into and we’re going to create a folder called tags inside tags is create a folder called functions and inside that we want to create something called tick dot json here we it’s pretty simple file Again pause to view it simply we need values and then your name space so mine is custom underscore block whenever you see this followed by a colon it’s probably the name space um and then main so that should be pretty straightforward and so what this says to the game is hey your This function is tagged as ticks so what the game treats that as is it runs this function every single tick which the game tries to run every 20th of a second so if we go into custom block we just have a folder called functions and then i have like to create Two or folders for each of your blocks just for for placing and destroying them which we’ll get to but also just general if they end up having functionality which i’ll get to in later videos if i ever make if i ever make those later videos then Yeah so first we want to do this main dot make function file so if we open this up as it says this is the custom blocks main loop so for block one there’s gonna for block one type of block you’ll need three commands hey guys future zack here again uh before i explain How this block works and what it does i want to stress the importance of these tags these are basically going to be the id of your block and you want to make sure that for a given block say block one that these ids are consistent for both the armor stands and The item frame um same with like other blocks of course as well so this is block two and they also pop up in the place and destroy functions which i will get to in a second but yeah i just wanted to stress the importance of these tags so the first one it says So executes as all the armor stands that are responsible for making block one possible and it says basically you’re on fire so it basically tells the armor stamp it’s on fire and that’s how we get that glowing effect so the armor stands pertaining outside file now the second command is actually placing any Blocks from any item frames that have been placed into your world so you want to do this one as execute as type because my frame tag equals block one and then it will run the place function again the namespace and then whatever folder your block is coming under and then this one It runs as all the armor stands at their location so for block one it checks for the block below it it checks um if it’s not cobblestone and if it isn’t cobblestone then it will run the destroy function again the namespace again the name of the block now block 2 is a Little simpler it’s only two commands as you can see we’ve got execute as so places this is the place command running with the item frame so it’ll run that command again these things and then the second command is the destroy so we did armor stand also note that this block is whatever block Your your custom block is basing its properties off of so for this one it’s gray stained glass because we need a transparent block and then that will run the destroy function and also notice that this is at its own coordinates rather than going a block lower because of Well the armor stand in a block 2 block sits inside of the block all right then we want to do the place and destroy functions so i don’t know why i minimized that i have too many things open oh well so we’ll open them both up so we’re gonna go place first so Remember this is an item frame running this command so firstly we want to execute at the item performance coordinates align it with all the axes so that’ll round down each coordinate so we get a very precise location just in case the arm stand is or rather the item Frame is placed on any of the blocks faces we know exactly where this coordinate is after it’s aligned then we can run the summon command for the armor stand and this will be these point fives make sure it’s in the middle of the block and then of course it’s the block above um Then we have all this nbt data so i’m going to extend this a bit and so what we have is marker 1b invisible 1b pose there’s a head pose um tags block one and then we’ve got armor items and so this is making sure it’s wearing the item frame has a head item And it has custom model data of one which tells the game you know check for that model file in the resource pack and then we want to execute at the um at the item frame we want to set the block right at its location to whatever block this happens to be Make sure this is the same as the file in main.mc function and then we want to execute at itself again align it with the axes again not really necessary but apply any and then we want to play a sound this is just for sort of the experience of the block because Otherwise it wouldn’t play any sound so i’ve got a playing minecraft block.stone.place you can make that any block you like um i recommend this staying as block and then this is the normal sort of distance for a sound so that’s fine and then it just kills itself so then the item frame Doesn’t exist anymore now with the destroy function this is running as the armor stand now so it’s detected that the cobblestone block is missing so it realizes it’s destroyed now it checks if the nearest player is in survival mode and it will summon the item of the um of your custom block Uh future zack again just uh to fix the bug that you saw in the intro where the item spawned too high uh this needs to be negative 0.5 instead of positive 0.5 so it’ll be item item frame count of one and all these complicated tags again please pause it if you Need to copy it i will also provide a link to the data pack in the description so if you can’t see this for whatever reason you can just copy it so we’ve got entity tag so basically when it’s placed down as an entity it’s going to have some of these Properties which will tell the game hey you need to place custom block again custom model data that just displays the block and then we have the name for the block making sure it’s italic false otherwise it looks like it’s renamed with an anvil and then give it some motion and pick up Delay just to make it seem like it’s kind of a more legitimate item just what normal items do the motion’s not exactly right because it doesn’t have any horizontal motions just vertical but it’s better than no motion then again if it’s in survival we’re going to Kill the item that the block dropped by default so in this case it’s cobblestone that is if the item exists so it’s trying to check for an item within a certain range and only one of them and then the armor stand is going to kill itself After that and that’s how you make a block one block now let’s move on to block two so block two again very very similar but there are some slight differences so place and destroy Okay so again we want to align the axes summon the armor stand this time this we’re summing at the coordinates of the item frame um again with the 0.5 displacement for it to be in the middle of the block um these tags are all the same except this is block two That’s a very important tag as well as this custom model data here has a value of two um then this one sets the block to graystand glass or whatever transparent block you’re using and this also plays a sound and that’s exactly the same command and then it destroys itself And then the next function again very very very similar so summon the item blah blah blah with all the properties it has its special name and custom model data Pause the video to take it in here and i’ll scroll over to the left pause it again yeah again very very similar the motion the pickup delay the name destroying the items say they have silk touch pickaxe just make sure to get rid of it so i don’t recommend Transparent items like glowstone that might drop multiple items because then you might have a problem trying to get rid of all of them you could give it a go it might work you know mess around with it test it that is if you’re using glowstone and then it again Uh removes the armor stand hello futurezak again or one last time um so i also think it’s a good idea to make this give function so inside of your lock folder and so basically it just gives you um the item with all the custom data so you can just Go and copy that from destroy make function it’s the same as um so this part to um yeah so you copy all that um everything in this ag tag so all of that you can copy it and then you paste it back here that’s what that is Actually know it’s not quite that curly bracket it’s like this curly bra and then everything else like that you copy that and then put it into this command and so of course making sure your tag is right the right blocks and the custom model data and the name as well And that is it that is the complete data pack and now you should have custom blocks in your world i hope you got everything again please remember to rewind and pause anything um feel free to ask me questions in the comments if anything was unclear but let’s head back into my minecraft World to really wrap up the video so i’m back in my world and now i’m going to show you how to give yourself the blocks so ron function your namespace custom block and then the give command and that will give you the item and it will stack with all the Other ones if you’ve done it correctly um and same with block two you know you can do that with all your blocks that you might have but um that is it so yeah thanks for watching please let me know if you enjoyed this video if you found it helpful Uh leave a like leave a comment if you have any feedback or you’re confused by anything also leave a comment and i’ll try and explain that i do plan on making this a series i won’t be a very consistent uploader if i do end up doing that just like different kinds of blocks Maybe like redstone power blocks and maybe even uh custom block guis um so let me know if you’re interested in that kind of stuff but anyways thanks for watching and i’ll see you next time Video Information
This video, titled ‘How to make CUSTOM BLOCKS with DATA PACKS | Minecraft 1.19 Tutorial [See Description]’, was uploaded by ZacNVR on 2020-07-24 06:27:58. It has garnered 21492 views and 485 likes. The duration of the video is 00:26:04 or 1564 seconds.
In this video, I explain two different methods of creating custom blocks in Minecraft Java Edition.
VERSION INFO The tutorial was made in Java Edition 1.16.1, but should work for 1.14 – 1.18.2, given that you change the “pack_format” values in the pack.mcmeta files: – 1.14 – 1.14.4: “4” – 1.15 – 1.16.1: “5” (as shown in this video) – 1.16.2 – 1.16.5: “6” – 1.17 – 1.17.1: “7” – 1.18 – 1.18.1: “8” – 1.18.2: “8” for resource pack, “9” for data pack – 1.19: “9” for resource pack, “10” for data pack
DOWNLOADS Resource Pack: https://drive.google.com/file/d/1Jp_oJ14A4-c13ptTDYzusWzYn-6H4P8b/view?usp=sharing Data Pack: https://drive.google.com/file/d/1psnA3gZqdQJQIJb1MROqWjak80vFsPN7/view?usp=sharing