Hey guys it’s Thomas here with techno vision and welcome to the next part in our modding tutorial series in this episode we’ll be talking about how to create a custom item tab which are those little custom tabs in the creative menu for your mod and it’ll have all the Items and blocks from your mod in that tab so in order to do this we’re actually not going to create a new class we’re just gonna do it inside of the main tutorial class or whatever you named your mod because I think it’ll just be easier to just type tutorial Dots tab or whatever the name of your mod is especially cuz we’re gonna make it static so in your main class here getting someone with the mod ID at the top inside of the class so right below do client stuff we’re gonna create a public static final and this is gonna be An item group and if you don’t know an item group is basically an item tab from Minecraft and we’re gonna name this in all capitals tab because it is a final and it’s gonna equal new item group and in parentheses we’re gonna put the name Of the tab so this is not very important it’s more for your code so to quotation marks and inside of here I’m gonna name it tutorial tab you can name it whatever you think fits best but this will be what we use to to add an item to it and We’re actually gonna use this to create a custom name in the game but we’ll do that later on so for right now just add some curly braces and open it up and we’re gonna of course import item group that’s very important and once you’ve imported item group inside of here we’re Actually gonna override a method in item group which adds a an item sack which is the icon so if you look at you know any creative inventory tab you’ll see that there’s an icon like I believe one of the icons is like a grass block I think One of them is like a sword or something I’m not really sure but we’re gonna add a custom icon for ours so we want to add override and this is just telling Java that we’re overriding a method from item group here or so we’re overriding public itemstack And its name is create icon and just make sure you have those parentheses and a curly brace of course and we want to hover over item stack and import that class and what we’re gonna return here is an item stack of the of the item that we’re gonna be displaying I know that’s Kind of confusing but let me just type it out and we’ll go through it so return new item stack and in parentheses here we want to put the item that will be our actual icon so I want my icon for now to be a ruby because that’s the only game Item I have added into the game and also because you know that’s just what I want but whatever you want your item to be I would recommend it’s an item or a block from your actual mod but what you’re gonna do is type registry handler again This is where we registered all of our our items that we’ve made so far dot and when you type dot you’ll see that there’s a list here I only have Ruby because that’s all we’ve ever made but you’ll see all your items and all your Blocks here when we get to that and I’m gonna just double click on Ruby you can see it’s registry handler dot Ruby and we want to do dot get of course and that just gets the actual item itself we can add a semicolon and this is all done so Basically what this is doing is it’s creating a custom item group a custom creative tab named tab and this is it’s like official name in the code and it’s setting the icon to our custom item right here and I just want to show real quick let me just file save all I just Want to show that if you want a Minecraft vanilla item as your icon instead of a custom item which I don’t really recommend but you know if you want to do that sure let’s get rid of this and instead of item stack what you want to type is I believe items I guess Would be all all lower case except the I items dots and then you’ll get a list of items here so let’s say we wanted it to be an apple items apple and you can see that works fine so that would set your icon to be an apple if we wanted it to Be a block we would do blocks dot and you could choose a block here we could do like block stock cactus and that would say your icon to a cactus but again I want a custom item so we’re gonna go to the class where we registered it registry handler dots ruby Dot get and it looks like I forgot to add a semicolon here just make sure you add a semicolon at the end of this last curly brace for for tab and we can move this up just a little bit and again you can do this in in a custom class you can Create a custom class that extends item group and name it whatever you want but in my opinion I feel like this is just cleaner because it’s way less code so now that we have this we actually want to change the the item group that our Items are in so go to your items package here in com dot whatever your name your name is dot whatever your name your mod is we got our items open up item base and in item base if you remember we set the group the the properties dot group To item group stop materials and again you can see item group dot this is all just the basic vanilla item groups but your custom item group is not going to be in here so what you actually have to do is get your main class in my case It’s this tutorial tutorial dot and then you can see tab is right there so tutorial tab and that is going to be how you access your tab in any class and we can actually hover over tutorial import real quick very important and again just to make sure that you guys understand Save all here in our registry handler class that’s in util again the you tow package whenever we create an item were using item base because we haven’t gotten too advanced items yet so these basic items are using item base and inside of item base we’re essentially for every item setting its properties to Or at least the group property to our custom tab here and that’s going to make sure every one of your custom items is in the actual tab alright so the final thing we want to do is actually create a custom name for our tab so if you go to The resources folder here and you open that up and you go to assets top the name of your mod and then you open up the lang folder we want to open up this en underscore US JSON file which holds all of our our names and we can create a new Entry by just hitting Enter and that should add a comma but you can add one yourself if it isn’t there and we want to put two quotation marks and the path to our actual tab is gonna be item group dots and then the name of Your tab and the name of your tab if we go to let’s close out of these real quick if you go back to tutorial or whatever you named your main class this is the name I’m talking about so just copy this name right here right click Copy go back to your en underscore us saw JSON right click paste there we go so it’s going to be item group dot the name of your tab and just add a colon at the end here and then to quotation marks and this is gonna be the actual name in The game so you can name this whatever it could be tutorial tab or whatever in my case I’m just gonna name it the name of my mod so tutorial and we don’t want a comma here because this is the last entry the last entry should never have a Comma so this is pretty much it and you can file save all and now we can run the game and actually see our tab okay so you can see that we’re inside of the game now and if we open up our creative inventory we can see that there is Actually a second page to our tabs and there it is there’s our custom tab and you can see it says tutorial of course and it has our custom image of the Ruby that we set and if we click on it you can see our items are inside right now All we have is one item but you can see it’s working perfectly and in the future all of your items and spawn eggs and blocks they’ll all be in this tab and you can see that our Ruby does work so yeah now you have a custom item group in The game alright so that’s gonna do it for this episode thanks guys so much for watching in the next episode we’ll be talking about how to actually create custom basic blocks so that’ll be really exciting but yeah thanks so much for watching and I’ll see you guys in the next episode Oh you Video Information
This video, titled ‘Minecraft 1.15.2: Forge Modding Tutorial – Custom Creative Tabs (#3)’, was uploaded by TechnoVision on 2020-04-10 02:32:02. It has garnered 42260 views and 1747 likes. The duration of the video is 00:08:14 or 494 seconds.
Learn to code a Minecraft mod from scratch in this complete tutorial series! In this episode, we create a custom creative tab for our items.
— Important Links —
● Model JSON: https://pastebin.com/zH6J3m8E ● Texture Guide: https://www.youtube.com/watch?v=Sg_znEXBD7k
● Discord: https://discord.gg/ZsB3Eha ● GitHub Repository: https://github.com/TechnoVisionDev/Minecraft-1.15.2-Modding-Tutorial.git
— Music —
● Phil Smiff – lake.side ● Xori – Dreamin ● Chill Out Records – Minute Mix
— My Channel —
● Subscribe: http://tinyurl.com/zbc7mwy ● Instagram: https://www.instagram.com/tomm.peters ● Twitter: https://twitter.com/TechnoVisionTV
#minecraft #modding #tutorial