Hey guys it’s thomas here with technovision and welcome to the next episode of our minecraft modding tutorial series in this episode we’re going to be covering tags which were previously known as the or dictionary and essentially tags allow you to group blocks items entities and fluid types really under an umbrella or a Group essentially a tag that puts them all together and says hey you can use all these blocks to substitute any of them in a crafting recipe so i guess the best way to explain this is um let’s say for example the wooden pickaxe in minecraft you can craft it with Any of the plank types like dark oak you know birch spruce oak all those plank types work not because minecraft makes a different recipe for every single plank type that would be a total nightmare what it does is it groups all the planks together under one tag called planks all the plank blocks And it says hey you can use just this tag in the crafting recipe which means essentially any of these plank types will work for this one recipe this is also how things like mod packs like like feed the beast for example which have multiple copper ingot objects from different mods It allows you to use the this object this copper object across mods for different uh crafting recipes so your copper ingot could be used in a different mod uh that has recipes for copper all right so what i’m going to do in this tutorial is show you how to create your own custom Tags how to use them in a crafting recipe how to override vanilla tags and how to use them in code so you can use them in an event or whatever you really need to use them for so to get started what you want to do if You want to make a custom tag this is a tag that is specific to your mod you want to come over to resources over here open this up go to data your mod id and inside of this mod id folder we need to create a new folder so create a new Directory and we want to name this just tags hit enter and inside of this folder we’re going to create four subfolders that stand for four different uh tag types essentially that you can use so first one is going to be blocks and this is going to store tags for Blocks as you would assume next one is going to be entity underscore types and this is going to allow you to group entities next one is going to be fluids like water or lava and the last one is going to be as you would guess items All right so when you’re making a tag what you want to do is first decide which category it fits under if you’re trying to group together blocks you want to put that in blocks if you’re trying to group together items you want to put that in items and so on and so on So just keep that in mind what we’re going to do is i’m going to actually make a tag called gems that’ll allow us to group together ruby our custom ruby object and the vanilla emerald object so you can use any gem essentially in our crafting recipes So what i want to do since those are items is come to our items package here right click create a new file and the name here doesn’t really matter but i would recommend naming it whatever your group is so mine is going to be gems because i’m grouping together emeralds and rubies So i’m going to put gems.json hit enter add the repository and we’re going to do some basic json coding so don’t worry if you really don’t know jason that well but of course it’s always better to know the syntax beforehand so what you want to do is open up with Some braces and inside of here we’re going to put in two values essentially two objects first one is going to be replace replace with a colon and you want to set this to false and add a comma afterwards so what this is gonna do for your tag if You set this to true this is going to have your tag your custom tag replace any other tags with the same name in like any other mod so if you know it’s a mod pack that you’re using that has multiple mods that all have a gems.json Um tag if you set this to replace it’ll replace all of those um that load you know before your mod of course um i would say just leave this to false unless you’re specifically trying to override another mod because if you set it to false it’ll just add whatever is in this Folder or this file rather to the other existing ones which is much better because it means that um there’s just more options for you so i would leave this to replace is equal to false unless you know what you’re doing um and then the next one is going to be Our values and it’s exactly what you think so values with a colon and we want to open this up with some brackets here because some square brackets because we do want to put multiple objects in here and this is where you’re going to put different items that Are going to be grouped under your tag so for example if you wanted to add a vanilla item to this tag group this gems tag group you would put uh some little quotation marks then the uh the mod id of vanilla minecraft which would be minecraft A colon and then the name of the item you’re trying to add so mine is gonna be emerald so that’s what i’m gonna add um now if you wanted to for example add an item from your custom your mod or you could do if we want to add a Second item here we do have to add a comma at the end what you could do is instead of minecraft you could put your mod id which is tutorial colon and then you can put the name of your object so mine is going to be ruby Uh so this tag is actually pretty much done uh what it’s saying here is it’s grouping together an emerald from vanilla minecraft and a ruby from our custom mod and it’s saying you can use either of these in a crafting recipe that uses the gems tag So yeah so we’re going to use this in a crafting recipe but just know that you can add as many values here as you want i don’t think there’s really any limit just you always have to add a comma when you add a new entry and then just you know uh pretty much Paste them all in uh until you’re happy with uh you’re with your group and uh let me just back up here file save all now i did want to show you really quickly a vanilla tag just so you sort of get a another idea of how this works um so i Did actually get the planck’s json this tag from vanilla minecraft and if you right-click and edit with notepad plus plus you’ll notice that um it’s you know exactly like we said this is the same format for all three or all four of these tag types so it doesn’t change it’s the same everywhere But you can see uh the just like with the planck’s um tag that they have set in vanilla minecraft they have a bunch of different plank objects and it’s saying anything that uses this uh this planck’s tag will be able to use any of these plank types in their crafting recipe So hopefully that makes it a little bit more clear and now we can move on to recipes all right so to use this actual tag in your recipe you want to go over to recipes and find a recipe that you want to change or modify i did already talk about recipes so Hopefully you sort of have this down but i’m going to take the ruby block jason here and in this recipe this crafting recipe we made a long time ago in like i think it was like the fourth or fifth episode um we have set here a recipe for Rubies all around the crafting recipe except for in the middle it’s going to have one diamond and that would help you or allow you to create a ruby block what i want to do is make it so that you can just use any gem instead of rubies But you have to use the diamond in the center so to do that for each of your keys you know we have a key here that’s set to an item i talked about that in the crafting recipe video so what you can do is you can actually set these keys To a a tag instead of an item and to do that for example we have our ruby item here i want to change this to gem so you can use any any gem so instead of item you want to have this just say tags and you want to do or sorry tag very Important not tags with an s it has to be tagged singular and you want your mod id if it is a custom one that is and you want the name of the tag so our tag is called gems so we would type jab gems again that’s Your mod id and then the name of the the tag this tag we just made down here and that’s pretty much it so what this will allow us to do now is use emeralds or rubies instead of just rubies for our x key here in our crafting recipe Now if you wanted to use a vanilla um tag for example the planks tag we have here i’m just going to test it right now for for here but i mean obviously you wouldn’t use planks for this recipe but what you could just keep tag here and instead of tutorial you would want To use minecraft if it’s a vanilla tag and then you just type the name of the vanilla tag and this one in this case is planks and that would allow you to use the planck’s tag here but again i want to use my custom tag so i’m going to leave it like this And this should work totally fine so let’s file save all and we can run the game and test it out alright so we’re inside of the game now and i have some of our gems here so we can actually try out this crafting recipe and we come over here so first let’s try Just the base crafting recipe now we did say that you can use emeralds and rubies in our tag here instead of just rubies or emeralds so what we want to do is try the original crafting recipe which was rubies all the way around and a diamond in the middle and there we Go we do have our block of ruby so that’s working great now let’s try the emerald that we set here with a diamond and there we go we got our block so as you can see we can now use emeralds and rubies for our crafting recipe and we didn’t even need to make An entirely new crafting recipe so this is going to save you a lot of time especially if you have a lot of different items that are very similar and are used in different crafting recipes all right so now i’m going to show you how to override a vanilla tag And add your own custom items to it or edit it or whatever you want to do so go to your desktop and to find some vanilla tags to edit you want to go to your file explorer file explorer go to percent app data percent go to dot minecrafts go to versions And hopefully you have a 1.16.1 version if you’ve played on that version open up the executable jar file with renrar or 7-zip whatever you want and inside of here is essentially your your game installation so you want to come to data minecraft tags and as you can see we’ve got our four Uh groups here so i’m actually going to override the uh the plancks tag so i want to go to blocks and i want to find planks and you can search for whatever you like here i’m going to drag it to my desktop and inside of here we’re going to add our Custom ruby block i know it’s like stupid doesn’t make sense to add that to the planks tag but i am just showing an example here so to add this to the game what you want to do is uh first go to your intellij and inside of here you want to go up Let’s close all of these you want to go all the way up to uh oh there we go uh you want to go up to data here and you know how we have our mod id folder here will be if we want to override a vanilla a recipe or tag or anything vanilla We have to have a vanilla folder so inside of data you want to right-click new directory and i’m just going to name this minecraft uh well you have to name it minecraft i don’t know why i said that’s so nonchalantly it must be named minecraft because this is the vanilla files So very important and just like we have here we want to add a new folder instead of minecraft called tags uh and again you can add whatever you want in here whatever is uh necessary uh for your tag so i’m just gonna add a blocks tag so i can just add a blocks Folder and we’re gonna drag it into here so make sure again if you’re overwriting a vanilla tag it has to be in the this new vanilla package structure that we’re making so i’m going to drag it into intellij drag it in refactor add the repository and we have our vanilla Tag inside of our mod now we want to modify it you can do whatever you want here you can remove some of these items change them up i’m going to add a new entry again we need to add a comma there and my entry is just going to be the Ruby block so our mod id comma and the name of our block ruby editor block and again this name here that i’m getting is the name that’s in our registry handler these names right here that’s what i’m getting uh so this will add our ruby Block to the uh plinks tag so now we can use the ruby block for things like like a wooden pickaxe i know it’s like stupid but just an example all right so now i want to talk about forge tags and forge tags allow you to create really awesome compatible items That you can use across all different mods even if they have nothing to do with your mod which is really cool just like the ironing thing that i mentioned earlier for mod packs so to do that if you actually go to the description here i have all the forge tags uh linked here In the minecraft forge github and you can see if we open up like items for example that there are actually a lot of custom groups that forge has made like for example the gems group is a perfect opportunity for us to add our custom gem to And you can see that there’s like a diamond and an emerald and if you open these up you’ll actually notice that it’s just one item but that’s because these exist so that mods can add to them over time and override them so that you know there’s a bunch of different compatibility uh with Different mods so for example i want my ruby or my ruby object here in registry handler i want this to be compatible with other mods if another mod has a ruby object i want them to be able to use my ruby in their crafting recipe even though my mod has nothing to do With their their mod so what i can do is i can find uh a category that i care about like for example gems and i can actually tap into it and use it and override it and add to it so let’s do that so for example um what you could do And we have to again make another sub category here in data is we want to add a new directory called forge and again this is all optional if this is something you want to do but i really recommend doing it it’ll make your mod really great in mod Packs so you want to make a new directory called forge and you want this to just again have a new directory named tags because we are adding some new tags here and i’m just going to add to the items tag so items uh and let me just check here again you can cross Check here’s some items now the one i want to specifically add to is gems so we want to make a new package in uh or a directory rather in items gems in my case and i want to add a a custom uh where is it a custom Json in here so what you could do is add to one of these or you could create your own so i’m going to create my own new file and i’m going to call this ruby.json add a repository and what we can do is just copy our gems here Just so we have an example um but there you go you pretty much have a forge tag now a custom forge tag that you can use and i mean i don’t really know what mods use a ruby forge tag instead of gems but if they do Then it will be added and my ruby will be able to be used so pretty cool and another thing i should mention if we go to like recipes and we go to our ruby underscore block you’ll notice here that i’m using the item the minecraft item diamond Now this is fine but if i really want my mod to be like compatible with a bunch of different mods to be able to use diamonds from all sorts of different like crazy mods that have like blood diamonds and all sorts of special diamonds what i can do Is change this to tag and then change the domain here to forge and then the directory i believe is gems slash and if we go to gems here in um our minecraft forge in the items tag uh if we go to gems you can see there is a diamond.json here If we use this instead so gem diamond again this is the directory uh what this is going to do just like we have here it’s going to have all of the items inside of this tag be able to be used in my recipe and sure right now there is Nothing but just a vanilla diamond in there but you never know someone could be playing a mod pack that has like a blood diamond in it and this will allow you to actually use that special item from a different mod in your recipe which is really cool And i really urge you to do this with all of your crafting recipes because trust me it’s going to make your mod so amazing and mod packs and people are going to love you for it so definitely do that but now that we’re done with all the jsons we can close all Of these out hope that wasn’t too confusing i know it’s a lot of information what i want to talk about is actual code use so you can actually access your tags in code and we can just make a test class here oh definitely don’t want to do that let’s close all these Um so let’s say for example let’s just make a test class a new class i’m going to name it tags So uh this is going to be a test class that i’m not going to actually use i’m going to delete it right after this video but just so that you can see some of the ways that you can access tags so you so hopefully you’ll be using this information in other places Like maybe an event or whatever you want to use it for but i just want to show you really quickly so if you want to access a tag that you have a custom tag what you can do is create a resource location object and we can just name this like my tag id And we can import resource location we want this to equal a new resource location and this is going to pass in two things first your mod id so tutorial.mod id and then your tag so what you’re going to put here is a string and it’s going to be the name The path to your tag so for example if you wanted to get uh let’s open up resources again if you wanted to get your custom tag that we just made called what is it called gems here then we would just put gems and add a semicolon and that would get your gems um Whatever it’s called your gems um tag but if for example you wanted to get like uh what is it called our forge tag here that we made you can see that our forge tag is actually in an extra subdirectory in gems so we would have to add again this is the ruby Tag here you would have to put gems slash ruby because this is the path so if it’s under a subdirectory then it’s definitely gonna need to be included in this path but i’m just going to have our our gems here for the uh the custom tag we made In our mod so this is going to allow you to get your tag id and what you can do is let’s say you have like an item i’m just gonna get a random item like item uh test item let me import this real quick so let’s say you have a random item and We can just grab like uh our registry handler dot let’s grab like a ruby so let’s say you have an item and again this is all hypothetical assuming that you have uh this in a different class you’re using this oh i forgot to do dot get because it is a registry object Uh so let’s say you have an item and your tag id what you can do is for example like uh you can make a boolean like is in group to check if your item is inside of a tag so like you could do itemtags.getcollection.getorcreatetag and you could pass in here your tag id So my tag id and then you could check if it contains an item like test item so again all hypothetical but what you could use this for is like to check in an event if for example like a one of your items is inside of your your custom tag and you Don’t have to use just custom tags you can also use vanilla tags like i could put like planks in here and that would grab uh well we would have to make sure that the mod id was vanilla so minecraft for the mod id uh and then planks and then same thing If you were using a forge tag this would have to be forge and then you know gem slash ruby so yeah hopefully you get the idea you can use these to sort of uh access your tags in the game so yeah that’s pretty much gonna do it For tags i hope you learned a lot i know it’s a lot of information really confusing but definitely mess around with it see what you can do and i will see you in the next episode You Video Information
This video, titled ‘Minecraft 1.16: Forge Modding Tutorial – Tags (#14)’, was uploaded by TechnoVision on 2020-07-20 16:04:02. It has garnered 8836 views and 312 likes. The duration of the video is 00:20:40 or 1240 seconds.
Learn to code a Minecraft mod from scratch in this complete tutorial series! In this episode, we utilize custom, vanilla, and forge tags to help improve our recipes and add cross-compatibility crafting between mods.
— Important Links —
● Forge Tags: https://github.com/MinecraftForge/MinecraftForge/tree/1.14.x/src/generated/resources/data/forge/tags ● Vanilla Tags: https://minecraft.gamepedia.com/Tag
● Discord: https://discord.gg/ZsB3Eha ● GitHub Repository: https://github.com/TechnoVisionDev/Minecraft-1.16-Modding-Tutorial.git
— Music —
● Chill Out Media – Minute Mix
— My Channel —
● Subscribe: http://tinyurl.com/zbc7mwy ● Instagram: https://www.instagram.com/tomm.peters ● Twitter: https://twitter.com/TechnoVisionTV
#minecraft #modding #tutorial