Okay what’s up guys so today I’m going to be starting a series which I’m probably just gonna call let’s code kind of like a Minecraft let’s let’s play except instead of playing Survival it’s gonna be creating data packs and things like that so with this first episode I’m Just gonna show you how a really tiny aspect of a data pack is made and I’m gonna be making an example item so today it’s gonna be a throwable of water block so basically a snowball which you could throw and then when it lands it summons A water block right where it is this is something that doesn’t need a data pack to run however it’s gonna be part of a data pack that I’m gonna be using inside of a custom map so it’s just going to help you go along the path of creating Larger more advanced data packs so we have to start somewhere and I want to start simple so I started with the planning already so basically what it’s going to be is a snowball which has a tag on the item so that it could be identified with commands and basically If the snowball hits a block then I want it to place water however we can’t just detect if snowball hits block because that’s not a natural thing we could detect as far as I know so what we first want to start with is the tag snowball So in order to do a give command very simply without having to do the more complicated text for creating a custom name what I’m gonna do is open up MC stacker and we’re gonna start with command blocks we’re not going to start in the data pack because it’s always Better to prototype with commands and there’s some other tips that you should know including that tip which are listed inside of my video on all the tips that you could use while creating your data pack anyway since we’re gonna start with the command blocks we’re just gonna go straight to MC stacker This is also one of the things I mentioned in that video it’s a very very useful online tool for generating commands especially when the syntax is too complicated but anyway I’m gonna start with a give command just for summoning the item so I’m just gonna go With snowball for the item and you can see it’s right over here and I’ll select snowball and so the only thing here is the syntax for selecting item custom item names it’s kind of complicated so it’s easier to just use this for that so for that value I’m just going Say rollable water that should be fine and then I could always change that later and then custom tags so here in custom tags this is something that can be detected with commands and makes it really easy but at the end of it you have to say water 1b or whatever you Want to say this water could be anything I’m just going to use water because it’s easy for me to identify so now all I have to do is copy paste this command into Minecraft and I should get a throwable water and if you don’t know if you want to duplicate items into your Inventory you middle click with the mouse button and you should get it now what you want to do is move on to the next section so now I have the tag snowball now I have to be able to detect if it hits a block so the way that I’m Gonna do this is that so basically how I want it to be is that if the snowball let’s just use a snow block to represent it I basically want to say so let’s say it’s traveling in this direction right and this novel boom it lands right there So I want it to detect that it’s about to collide and then since it knows it’s about to collide I want it to then summon a water block right where it is so in order to do that I could use these vector coordinates which basically do relative coordinates but based on where The object is facing so what I want to do is basically if the blocks around it that it’s about to collide into are not air then I want it to so some in water right where it is so I’m just going to do a repeat command on always active so What I want to do is I want to execute a command if it detects that the block in front of it is not air so what I want to do is I execute I’ll have a full video on the execute command but I want to execute as and then all entities so this Will run as all of these entities and then I want the type to be a snowball and I want it to have so remember earlier we gave it the we gave it the tag of 1b so the way that we select this and if you don’t know how to select Something to detect it what you want to do is try to get the entity data and this is also one of the tips in that data pack video which you should really check out so using you slash data get entity and then I want to do all entities type equals snowball because I Want to be able to know how to select I want to know how to select the and you have to put a limit I want to know how to select that tag and you have to put limit equals one that’s just how data get commands work so I’m going to throw One of these in the air and then activate the command now we have all of the data on it so in order to access all of this entity where it says snowball has the following entity data I have to type env T equals so I do n V T equals And then two parentheses now I want to go in and find where I see water 1 B now I see water 1 B’s right here but I don’t want to just type water 1 because if you’ll notice if we go before that water 1 B is inside of item C you can see item here and then it’s within these tube brackets so I have to first type item : parenthesis and then water won’t be so it’s n b t equals parenthesis item : parenthesis and then water 1 b and now i Want to make sure it’s targeting it correctly so I’ll use the say command this is also something in my data pack tips so you should really go watch that video so we do run say hi so now if I throw a snowball in the air Oh see That’s why I use the say command so that you can make sure it’s actually working let’s see we’re doing it as all snowballs with okay so there is another thing I missed if you go into item you’ll notice there’s another thing called tag in which water is inside so I Just forgot about this it’s item and then tag and then inside of tag see there’s display but that is it’s outside of these to see so it’s not display so it’s item tag and then water so I just have to add there we go okay now if I do it it Should work see now as you’ll notice I just types everything in chat until the snow ball falls down it’s just gonna keep spamming hihihihihi which means we are correctly targeting the snow ball so now that we finished with the slush say command we can’t continue so now we Want to use the location so I’m gonna do a full execute video but right now I’ll just go ahead to execute as now we go at so we want to execute from the position of the snow mole so at s means at whatever Kenta T is currently running it Which because we set as at the entity and as the entity that means s is now the snow ball so basically running as a snowball at the position of the snow ball now we want to say unless so we’re gonna set it to water unless the block that is in front of it So that’s why you use these vector coordinates and then one on the very end then air oh you gotta say unless block unless a block in front of it is air then run set block no way we only want it to override air so I’m gonna use a Fill command because you can use your place so fill the coordinates from its exact point and fill it with water and then replace air so now but the problem is that this will only set it if it’s going exactly forward into a wall so if I put it right here See it summons water however the problem is if it’s not going directly into the wall it’s not going to detect anything in front of it but it’s still gonna disappear so if I throw it out a low angle it just disappears because it doesn’t detect a non-white or block I’m In na nare block right in front of it because it’s only not it’s only not running if the block in front of it is air but since the block in front of it stays air until it dies and never actually places the water so I also want To have something that places it if the block under it is also there so what I want to do is basically do that same thing but then do it for the block under it so now if it if it goes over a block oh there we go Every goes over a block it does that but now at certain angles it’s still not going to work like earlier I just got an angle that wasn’t going to work so I’m now I have to figure that out but first we have another problem so the problem Is that if we throw it right on top of blocks see if I could get it it’ll place many water sources because it detects non air blocks under it so in order to counter this what I’m gonna do is just have it so that on the first block that At places it dies so now we’re gonna have multiple commands so now is the time I’m going to move it over to the data pack so I’m going to go to the world saves folder and go over to data packs and I have my data pack here Utility jump I set it up just how like I set it up in my tutorial video for how to set up a data pack so go check that out if you want to know how to set it up but if you’ve got it set up you can go Over to functions and make sure your loop function is in there so here’s my loop function so now you can move the commands right into this loop function okay now I move them right in now I’m gonna save this so in order to save the changes you have to first save the file Which is ctrl s command S whatever you’re on and then in game yet to do / reload and then that message is from another data pack bling at it which is for bling but anyway now if I destroy these it should still work yep and we Still have that issue so I’m gonna have to do that workaround for the issue basically just gonna change whatever run command is so under the same conditions in which of what I’ve placed a block of water it would also have killed the snowball so it’s very simple slash kill At it that’s very simple and I’m also gonna label this since I’m gonna be adding other stuff I’m just going to call this section throwable water then this is gonna be what is this gonna be this is actually it just doesn’t need subsections because it’s a very simple Pack so now now if I do it you should see only one water block okay so for some of the throws I was doing the snowball still wasn’t popping so I was doing some more tests and I figured out that the reason see if I do this It’s not popping and so I was thinking it the snowball looks like it’s disappearing closer to me you can see the particles are falling like right over here so I was thinking maybe the snowball is dying before it gets close enough to the wall so I did some tests And by setting the blocks 1.5 blocks in front of the snowball to air and so it looks like that’s the reason it’s getting destroyed before it can actually get close enough to trigger the thing so what I have to do is just basically do the same things that I already have Except instead of just over one block I should also add 1.5 blocks and I’ll keep doing that every time I see every time I see the snowball not popping I’ll just add another distance and I’ll just experiment just like how he did it just now so I’ll just add this And it should be working fine you and so it should be working so I’ll just keep testing it oh yeah and something else I wanted to add is I wanted to add sound effects so that when this gets thrown it doesn’t just like place the water down without any sound so what I Want to do is I want to make a play sound command so just slash play sound and then I’m gonna select the sound so I already decided what sound I want I’m gonna use so there’s a lot of difference of this ambient block and I’m just going To use entity and then I’m gonna do generic dot splash cuz it’s just a water sound and then I’m just gonna put it in the master Channel so that’s basically we got all these different sound areas and master volume is just the simplest I’m desperate a master and then for all Players and I don’t need the rest of it so that should work so I’m gonna paste that into here so I’m just gonna duplicate this and then insert this command and it should work just fine so if I go after the run and just replace what’s there with the play sound and I Do command s go over to minecraft reload it and it should make the noise there we go yeah so that’s it so that’s a very simple data pack that you didn’t even need to use a data pack for however this is just one of the small steps and taking to Create larger data packs in the future so I have these products projects lined up so we have a dump gun which basically boots you up when you shoot it a jump pack to launch you high a jet pack to fly obviously a grapple hook which you could basically throw and then climb up And then a deployable platform which is something that you could just some in a platform in front of you or like throw a platform and then goop which it’s just a throwable slime block it’s gonna be basically the same as this so I might not make a video on that and a throwable Water block which we just did and is very simple so things like the jetpack jump back jump gun and the grapple hook those are probably and the deploy ball platform these are going to be a lot more complicated than this one so stay tuned for the rest of the series and Also look forward to more complicated videos on specific commands like the execute command so see you guys next time Video Information
This video, titled ‘Let’s Code Ep. 1 – Throwable Water || Minecraft Data Pack Tutorial Series’, was uploaded by Timber Forge on 2019-08-03 22:20:38. It has garnered 52318 views and 1545 likes. The duration of the video is 00:16:00 or 960 seconds.
This is the first episode of a series that I will be doing in which I will be creating small data packs just like this one in order to give people a good example of how creating data packs is done. I hope to show those who are interested in getting started in creating data packs how it can be done, starting from something very simple and eventually going out into more complicated projects.
Check out my new website! https://tinyurl.com/timberforge
Join our discord for help and inspiration! discord.gg/bwBsSbr
#datapacks #minecraftmods #minecraftdatapacks