Let’s add a custom item to Minecraft Minecraft modding courses with close to 100 topics ranging from Custom tools and armor to custom block entities all the way to custom mobs Linked In the description below oh right we finished us back intelligent once more and in this tutorial we’re gonna be adding a Custom item to our fabric tutorial mod over here for 120 and this is going to be a very interesting indeed so for this first things first in the tutorial mod package we’re gonna right click new a package called item and then inside there we’re going to right click new Java class called the mod items class now when you create this and you make a GitHub repository you will get this add to file over here you can simply add it the file will turn green and everything is going to be fine now the more items Class is going to be sort of a helper class which is going to register all of our items so that Minecraft actually knows that we have added items to do this we’re first of all going to make a register mode items method this is going to be a public static void register mod Items no parameters needed and inside the actual method in the actual method we’re going to put in tutorial mod you can see where it actually starts suggesting this to us when you have one of those things selected over here in the suggestion you can hit the Tab Key It will auto complete the word and it will also add the import over here you can then continue dot logger this time so I put in a DOT and then I can I can choose logger here and I once again hit the Tab Key to auto complete this and Call the info method once again tap to autocomplete and then here I’m going to say registering mod items four and we’re registering the warm tutorial mod.mod ID let’s just say simple output here and it’s not strictly necessary however I do like to add this and the register mod Items method will now be called inside of the tutorial mode class so we’re going to reopen this and in the uninitialize method right here we’re going to say mod items dot register mod items you can see once again it suggests this to us hitting the Tab Key to call This returning to the mod items class we will need another helper method we will need a helper method to actually register the items and this is going to be a private static item over here from net Microsoft item once again tap to autocomplete and it will import the Correct class we’re going to call this the register item method you will take two parameters a string name parameter as well as an item parameter called item this particular method will return registry making sure this is extremely important pay close attention to choose net Minecraft registry you do not want To choose Java RMI registry then you will run into an issue you want to choose net micro registry registry so double check if if you get an error over here you can check at the top here in the import that is net micros registry registry if this is not the registry Class you’ve imported then you have imported the wrong class you have to delete the import and import the correct class then once again registry.register we’re going to pass in Registries Dot item tap to autocomplete and then a comma and then a new identifier first parameter of which is going to be Tutorial mod.modid and then second parameter is going to be the name and after the first closing parenthesis we’re going to do a comma and then put in the item and there you go if at any point in this you might get an issue over here you can always take a look at The GitHub repository Linked In the description below where all of this code is available and you can compare with your own code so if you have any typos anywhere you basically are going to find it right there but that is the register item method and we can now start Registering our items to add our new items what we’re going to do is we’re going to make a public static final item I’m going to call this the Ruby or uppercase in this case I’m going to pull the register item method first parameter which is going to Be a string and we’ll see this name over here right this generates automatically the the name colon you don’t have to type this out if you were to type this out look how this looks completely different than this I’ve seen this multiple times this is a thing that IntelliJ ads don’t type that out now in this string we’re going to give it a name now this is going to be Ruby this is the same rule that the mod ID follows so it all has to be lowercase it can be uppercase can contain any spaces then as A second parameter we’re going to make a new item from netmicro item over here once again tap to autocomplete and inside of it we’re going to make a new fabric item settings once again it suggests this to us when I auto complete this and we’re going to end the line With a semicolon and with this we have successfully added an item to Minecraft now of course it doesn’t have a name and it doesn’t have a texture and it’s not even added into any creative mode tab now luckily we can fix this let’s first of all tackle the creative mode tab but This we’re going to make a new private static void I’m going to call this the add items to ingredient tab item group and this will take in a fabric item group entries over here I’m going to call this entries and inside of it we’re going to say entries dot add and then Just passing in Ruby and then inside of the register mode items method we’re just going to call Item group events modify entries event item groups dot ingredients dot register and then mod items and you can see it already suggests to us colon colon add items to ingredient tab item Group that’s exactly right I guess we can omit the tab here because item group basically is a good name so this is going to be the add items to ingredient item group awesome any other items would be added here in this add items to ingredient item group method and they Would also be added to the ingredients tab if you want to add something to another tab you will just add a new method you would call this modifies event again with a different item group from vanilla here that’s also quite important this is the way to add items To to vanilla item groups we’re going to see in just a moment after we’ve added the item how you can also add a custom item group but more on that later but first we somehow have to give our Ruby a name as well as a texture how do we do This well we’re going to navigate to the resources assets tutorial mod folder and we’re going to right click and make a new directory this is going to be called Lang spelled l-a-n-g you need to draw mode folder once again we’re going to make a new direction we call models very Important that this is models plural and once again you need tutorial mode folder right click new directory call called textures then in the models folder we’re going to right click new directory called item singular this time and similar to the textures right click new directory code item this is the full Assets folder directory that we’re going to need so double check that this is exactly spelled correctly for you as well so this is going to be assets your mod ID Lang and then we have models inside of the models folder we have an item folder and then a textures folder In which we have an item folder we’re going to start with the Lang folder this is needed for the translation files and inside of it we’re going to right click new file called en underscore us.json so that’s the exact name of this file and this is going to well basically provide Translations from keys to English this needs to curly brackets here and then we need to define the key the key is going to be item Dot tutorial Mod Dot Ruby and then we want a colon and then the name displayed in the game how does this get created well we have just Created an item right we think back this is an item so we’ve registered an item with the name Ruby this is indeed correct and it is under the tutorial mod mod ID and that’s how the key over here basically gets created those are all separated by A DOT and then here this is the actual name displayed in the game and this can include any type of character this can include spaces it can include numbers or whatever you want even so early characters this is basically a free-for-all and our item actually has a Name but it doesn’t have a text to it so how are we going to give it a texture we’ll do this via an item model Json file so in the models item folder we’re going to right click new file called ruby.json and it’s extremely important that the name of this file matches the Name given to the item so once again this name right here Ruby has to match exactly this name and then the file has to end with Dodges now this file I’m going to type this out and then I’m going to explain the contents so we’re going to have a parent over here the Parent is going to be item slash generated and we’re going to have textures to find those textures are going to be layer 0 all Poland tutorial mod colon item slash Ruby now you might see yourself what the frick is going on here what is all of this no worries at all so We can see the parent over here item generator basically just means that this is how we are going to display this particular item in your hand and in the inventory so this item generated is the normal way that an item gets displayed you’ve probably seen this a thousand Times when you have a diamond for example in your hand the 2D texture gets extruded a little bit in 3D space and that is basically what’s going to happen with our custom Ruby here as well and then we have to define a texture over here now we’re defining the texture Called Ruby and we’re going to search for it in the textures folder so this is going to be this folder right here under the tutorial mode mod ID so there’s going to be tutorial mode textures and I’m going to look in an item folder and we’re going to look for the ruby.png and That’s how basically the contents of a normal item model Json file are constituated it’s actually very straightforward once you know each individual element now what’s very important is that the code as well as the Json files are all included in the GitHub repository so if something doesn’t work your texture doesn’t work Simply compare your Json file to this Json file and see if there’s any discrepancies it has to be exactly like this it can’t be parent with an uppercase P that doesn’t work it can be parents it can be items with an uppercase I I’ve seen all of these Things make sure that this is exactly written correctly it has to be layer 0 with a lowercase L textures with an S all of this has to be exactly right and then we can add the texture this is also going to be available to you and as you Can see this is the ruby.png instead of the item textures folder in the tutorial mod folder exactly how what we’ve defined here in the item model Json file and with this we’re actually ready to go into the game for the first time and see our custom Ruby in action alright finals Back in Minecraft and let’s just take a look in the ingredients tab at the very bottom we should find there it is our Ruby has been successfully added to the game and it looks freaking awesome and well that is one item but one is none so let’s add a second one basically Sometimes quite a few people are confused on how you add a second item and the thing is like it’s you just add a second item here you don’t have to make another more items class or anything like that that would be crazy you just say public static final item And there’s going to be a raw underscore Ruby and this could be equal to the register item method once again we’ll call this the raw underscore Ruby and this could be equal to a new item with new fabric item settings and Bam second item added now once again the same issue Before is our raw Ruby it is not added to an item group yet so for this we can click here press Ctrl D to duplicate this and then the raw Ruby over here then we can go into the enscore US Json file we can do the same thing just click On this line print press Ctrl D and then add a comma over here in between I’m going to change this to the raw Ruby and similar here raw Ruby for the display name for the item model you’re going to take the item model and you’re going to Drag it into the same folder while holding Ctrl this will duplicate the file and we can then rename this we’re going to call this raw underscore Ruby I’m going to hit OK and then the texture that it references is also going to be raw underscore Ruby we didn’t just have To copy over the texture over here this is of course also going to be available to you you and done that is basically a second item added pretty much fairly quickly and as you add more items you’re gonna get used to this and it’s going to become a breeze but we’re not quite Finished with this just yet because we also want to add a custom item group so in the item package once again we’re going to right click new Java class I’m going to call this the mod item groups over here this will have a public static void register item groups method which We’ll call tutorial mod.logger.info and this is going to be registering item groups for tutorial mod.mod ID and let’s immediately call this we’re going to call this at the very top over here so there’s going to be the more item groups that register item groups awesome and then to add the Item group we just want to say public static final item group from net micro item right here Ruby underscore group and that’s going to be equal to registry once again making sure we choose net mic with registry extremely important that register Registries dot item group comma A new identifier passing in the first of all tutorial mod.modid and then the name Ruby we’re gonna format a little bit differently after the first closing parentheses we’re going to do a comma and then a new line and then we’re going to call the fabric item group the first One right here from version one dot Builder and then we can call all sorts of method on here the first method that we want to call is the display name and that’s going to get a text.translatable instead of here we’re going to make a new string call it item group dot Ruby After the second closing parenthesis we want to make a new line and we’re going to call Dot icon we’re going to make a supplier now A supplier is going to be an open and closing parenthesis and then a sort of an arrow over here with a minus and then a bigger than sign Then a new item stack and in here we’re going to put mod item start Ruby after the second closing parenthesis we’re going to call the entries over here I’m going to start typing display and you can see it basically suggests the entry collector to us we’re going to hit the Tab Key and I’m going to make a open CL in open curly bracket hit enter and end this with a semicolon and then here at the very end not the last closing parenthesis but the one before that you want to hit the dot build over here and Then no more errors should be present once again if any part of this was a little bit confusing the code is all available to you we’re going to go through each of these means the display name well that’s just going to be a translatable name that we’ve just added Here that is going to be displayed when you hover over your custom item group and we can immediately translate this so just in the enr scroll use Json file we’re going to add the key this is the item group dot Ruby and this is going to be the Ruby tutorial group how about That awesome now this is translated the icon over here that’s just going to display the Ruby and then between the curly brackets this is where we’re going to add all of our custom items so we can say entries dot add and then just say more item start Ruby and we can Duplicate this at the raw Ruby and there we go now we’ve added the Ruby and the raw Ruby to our custom Ruby group and the really cool thing about this is that you can add any type of items you can even add vanilla items to do that we’re Going to say items dot for example diamond and the order you add them in right here is also going to be the order that you’re going to add them in the item group pretty freaking cool and with this we also have a custom item group so Let’s go into the game one more time and actually take a look alright fences back in Minecraft and let’s just take a look and you can see we already have a page two over here and that is exactly what we want to see we have the Ruby tutorial Group we got the raw Ruby we got the normal Ruby and we got the diamond in here absolutely freaking fantastic and that is a great start this awesome tutorial series run that actually concludes this tutorial right here next time we’re going to add a custom block To Minecraft and that’s gonna be done in this video right here hope to see you there and until next time so yeah Video Information
This video, titled ‘Fabric Modding Tutorial – Minecraft 1.20: Custom Items & Creative Mode Tab | #2’, was uploaded by Modding by Kaupenjoe on 2023-07-06 14:59:53. It has garnered 5271 views and 185 likes. The duration of the video is 00:14:21 or 861 seconds.
In this Minecraft Modding Tutorial for Fabric, we are adding a Custom Item to Minecraft 1.20, as well as a Custom Creative Mode Tab!
== MODDING COURSES == FORGE ▶️ https://url.kaupenjoe.net/CourseForge120X FABRIC ▶️ https://url.kaupenjoe.net/CourseFabric120X
== COMPATIBILITY == ▶️ Compatible with 1.20 & 1.20.1
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Fabric-Tutorial-1.20.X/tree/2-customItems Assets Zipped: https://url.kaupenjoe.net/mbkj49/assets
== SUPPORT ME ON PATREON == ▶️ https://www.patreon.com/Kaupenjoe
== 25% OFF FOR GAMING SERVERS == ▶️ https://www.bisecthosting.com/Kaupenjoe
== TAKE A LOOK AT MY COURSES WITH COUPON CODES == ▶️ NEW Forge Modding with Minecraft 1.20.X: https://url.kaupenjoe.net/CourseForge120X ▶️ NEW Fabric Modding with Minecraft 1.20.X: https://url.kaupenjoe.net/CourseFabric120X ▶️ Complete and Roblox Lua Game Development: https://url.kaupenjoe.net/RobloxCoupon * ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 *
== SUPPORT ME ON PATREON == ▶️ https://www.patreon.com/Kaupenjoe
== SOCIALS == Discord: https://discord.com/invite/yqxykanpWf Personal Twitter: https://twitter.com/Kaupenjoe
Instagram: https://url.kaupenjoe.net/tutorials/instagram Facebook: https://url.kaupenjoe.net/tutorials/facebook Twitter: https://url.kaupenjoe.net/tutorials/twitter TikTok: https://url.kaupenjoe.net/tutorials/tiktok Written Tutorials: https://url.kaupenjoe.net/tutorials/blog
== LICENSE == Source Code is distributed under the MIT License. Additional Licenses for other assets can be seen below or in the accompanying CREDITS.txt on download.
== AFFILIATE DISCLAIMER == * Some of the links and other products that appear in the video description are from companies which I will earn an affiliate commission or referral bonus from or are my own products. This means that if you click on one of the product links, I’ll receive a small commission or additional kickback without any additional cost for you. This helps support the channel and allows me to continue to make videos. Thank you for the support!
== HASHTAGS == #Minecraft #MinecraftModding #MinecraftTutorial #Kaupenjoe