Hello hello hello everybody and welcome back to another minecraft mining tutorial for version 1.19 in this tutorial we are going to be covering tags now if you aren’t aware of what tags are which you might not be it’s completely fair to not be um tags are essentially essentially a way to define Particular behavior about something so say you wanted um a selection of blocks which could do something and he wasn’t sure how to define those blocks so you’re not sure whether to hard code them like have a list in the code or if you wanted to somehow have it be adjustable by the player And tags are essentially that second option so they avoid the hard coding and they allow players to be able to change your tags with data packs and that is a really good modding thing or just a really good thing about the game is that they have gone that way To allow their users to modify things which they might want to change so let’s go ahead and let’s let’s talk about what we’re going to be adding a tag for so the reason we’re going to be adding a tag is if you remember in our tools tutorial We had to put null here for this tag and that’s not great okay that’s not really very good so we actually need to put a well we don’t need to put a tag in here you can leave it as null it’s just not really a good idea so We need to go ahead and put a tag in here obviously you can use tags for whatever you want in future tutorials we’ll probably be using tags for other things so this is just a tutorial to get you started with how it works so yeah i mean let’s just get started so We’re obviously going to be creating a block tag for this so let’s actually come into our block init class and we’re going to create a subclass so we’re going to say public static class tags and we’ll call it yeah we’ll just call it tags and in here All we’re going to want this is very very simple so we’re going to want a public static final and this is tag make sure you get the right tag so it’s the one from uh i think it’s this one com.mojang and this is generic so this takes in the Type it’s type we’re going to be using is block and i’m going to call this needs underscore um example underscore tool is equal and then this is equal to block tags dot create and this takes in a resource location so we’re going to want a new resource location of minerable forward slash Needs and for example unscrew tool and is that the correct thing here no it’s not so it’s not tag it’s tag key and we just need to import that there we go get rid of tag that wasn’t the right thing and that’s pretty much it you now have a Tag and to do the four items i’ll just quickly show you in this class just to give an example so you would do tag key type item um item tag is what i’ll call it is equal and it’s really as simple as this item tags dot create resource location That is actually something i forgot so here we need to put our mod id in here as the first parameter and it would just be the same here so tutorial mod id and then you know wherever you want it to be so you know item tag Boom you now have an item tag you now have a block tag you can also do the same for i believe um entities and fluids i think those are the other two options but we just want our block tag for now so one thing we are going to do we’re Just going to simplify this a little bit will create a method here so a private static um tag key of type block and we’re just going to say create and this will just take in the location so string location and this will just return block tags dot create we’ll first put in It needs a resource location first but then our mod id and then just location that way all we need to do here is instead of saying block tags dot create blah blah blah blah blah we can just say create and then this string there boom that is a lot simpler Another thing you might want to do is create one for forge so instead of saying your mod id you might want to instead put forge and say create forge that is if you wanted to create a tag in the forge directory or you can always create one in the minecraft directory as Well so create minecraft and then in that case you can just remove the mod id parameter but um we’re actually not going to need those two at least not for now uh maybe in the future we will come back and recreate them so okay yeah that’s that’s fine So yeah now we can just go back into our block class and no entire item in it i mean and then we can say blocking it dot tags dot needs example tool and now what you can do is you can put something like um if we come back into our blocking it If you remember in our block tutorial or our block drops tutorial we set these two to be in a respected tag so let’s just have a look what we did go minecraft tags you see here we have the needs iron and stone tools what you need to do if you want yours to Work is coming to data and then your mod id and just create a new directory tags for slash blocks and in here you can just create your own so you can say whatever you named your tag so we named ours needs underscore example underscore tool dot json of course And then you can just put the stuff in here so i believe the first value is replace we’ll put false and then you can say the values and then your array so you know say for example you want um i don’t know um tutorial mod pull on example underscore example to unscrew block So you want that to be in requires example tool and then we can just remove this needs iron tool if we wanted to i’m actually going to remove the stone tool and put the normal example block in there and yeah you now have the tags so that Just gets rid of your error pretty much um yeah that’s it i mean we don’t have anything to test in this tutorial because it’s not really going to make a difference so yeah i hope you guys did find this tutorial useful if you did please do be sure to Punch that like button and subscribe if you really enjoyed please do be sure to share it and yeah we’ll be doing recipes next so i’ll see you guys then good bye [Applause] Video Information
This video, titled ‘1.19 Minecraft Forge Modding Tutorial – Tags’, was uploaded by TurtyWurty on 2022-07-12 16:30:04. It has garnered 2817 views and 69 likes. The duration of the video is 00:09:35 or 575 seconds.
Hello everyone, in this video we will be creating our own tag that can be used for our tool set!
In the next video we will be covering how to create our own crafting and smelting recipes! Remember, if you have any problems, please join the discord that is linked below!
–Links– Patreon: https://www.patreon.com/turtywurty Discord: https://discord.gg/BAYB3A38wn Github: https://github.com/DaRealTurtyWurty/1.19TutorialMod Trello: WIP