Let’s add some custom items to minecraft oh all right francesco’s back on intellij once more in this tutorial we’re gonna be adding some custom items to minecraft 119 with a fabric so how is this going to work well it actually isn’t that complicated all things considered and Let’s just jump right into it so in our tutorial mod package we’re gonna right click a new a package called item and then inside of there we’re gonna right click new java class called mod items now this window will appear if you have added a github repository to your Project and you can simply say add and that’s going to be fine every time you add a new class or a new file then this is going to appear you can also just check the bottom left corner there and then it should also work as well so how Can we add an item well first of all we need two new methods for this and that’s going to be a public static void called register mod items and this will simply say tutorialmod.log and then it’s just going to say registering mod items or tutorialmod.mod id because i usually don’t like to keep This method empty then we’re going to go into our tutorial mod class and in the on initialize we’re just going to say mod item start register mod items so that this particular method there is called and then we can proceed to the other method the other method is going To be a private static and it’s going to return an item you can see it already suggests to us the net minecraft item and that is correct i’m going to autocomplete this with the tab key and i’m going to call this the register item method over here with a string parameter Called name and an item parameter called item this is going to return registry and this is very important we have to choose net minecraft util registry do not choose java rmi registry net minecraft util registry you click on this and then you press the tab key to autocomplete and you can double check That the import here is correct then you’re going to call the register method registry dot item comma a new identifier tutorial mod and mod id then passing in the name and then after the first parentheses passing in an item and then ending it all with a semicolon and now We can register our custom items over here let’s just start with the first one this is going to be a public static final and you can see i only type in the first few characters and then autocompleted always with a tab now this is going to be an item again and this is Going to be called let’s start with raw tanzanite over here so this is the actual item that we’ll add and then we’ll call it the register item method over here and then we need to pass in a string so we’re going to start with the quotation marks this name here this Generates automatically you do not have to type this out that it’s just the name of the parameter that we’re currently passing in and this is of course going to be raw underscore tanzanite now what’s important about the name here is that this naming conventions follows the same naming convention that your mod id Follows meaning that you can only have lowercase characters underscores dashes and numbers no uppercase characters right now in this particular name over here so keep that in mind and then the second parameter is going to be a new item which needs some new item settings now we’ll choose the fabric item Settings over here we’ll auto complete it with those and then the item settings in this case this is a builder pattern so you can call it different methods on it and you can keep calling them so you can call multiple methods for our purposes we just want to assign a group Over here so we’re going to double click on the group and we’re just going to say this is going to be an item group dot miscellaneous let’s say so once again i click on it and autocomplete with tab and then just end the line with a semicolon we’re going to see after we’ve Actually seen the item inside of the game how to add a custom item group as well that’s going to be shown in just a moment but this isn’t everything we need some more things and that is going to be well what about the texture what about that exactly and also what about the Name we don’t want this to be called raw underscore tanzanite in the game absolutely you are correct and for this we need to go to the assets folder because now here we need to create our folder structure which is very important so please pay attention to this it is Important that you get this absolutely right so in the assets folder you’re going to right click new directory and this is going to be called tutorial mod or whatever your mod id might be this has to be completely correct otherwise it will not work now in your tutorial Mod folder you’re going to right click again directory and make a block states folder written exactly like this once again in the tutorial mod folder you’re going to right click new directory called lang lang and then once again in the tutorial mod folder right click new directory called models and then last Time in the tutorial mod folder right click new directory and this is going to be the textures directory so you can see make sure that those four folders are all contained in the tutorial mod folder and the tutorial mod folder is contained in the assets folder and the assets Folder is contained in the resources folder then we’re going to proceed inside of the models folder we want to right click new directory called block and then also in the models folder right click new directory called item very important that this is block and item singular and not plural same inside of The textures folder right click new directory called item and right click new directory called block well this is the full folder structure that you need please make sure that this is done correctly and then you should be fine and now we need to add some json files So let’s start at the very top block states luckily we don’t need any block states as this is an item block states are important for blocks which we’re going to see in the next tutorial the lang folder however is going to contain the translation file so we’re going to Right click here new file and we’re going to make a file called en underscore us.json make sure this is written correctly with the json file ending as well and nothing crazy over here ian underscore us.json and we’re just going to hit enter we’re going to add it to git and then we can Actually add something to it as well for the in underscore us.json file we’re just going to type a curly bracket the closing curly bracket will generate automatically we’re just going to then hit enter we want to translate the raw tanzanite item so how do we do this well We’re just going to type the quotation marks once again the second quotation mark will generate automatically i’m going to say item dot tutorial mod dot raw underscore tan the knight and then a colon after the closing quotation mark another quotation mark raw tanzanite and there you go so how this Is set up should be fairly self-explanatory we’re making a new item this is our mod id and this is the name of the item given right here so this should be fairly self-explanatory how this comes together in this case and that is then how the actual item name Will be displayed inside of the game well we’re not done just yet we also need a item model well next to the models item folder right click there new file and this is going to be called the raw underscore tanzanite.json once again this is very important that the name here matches Exactly the name given right here otherwise it will not work so the file name here has to match exactly the contents of this are a bit more complicated but i will type this out and then i will explain so we have a parent colon item slash generated comma Textures pollen open curly bracket layer 0 colon tutorial mod colon item slash raw underscore tanzanite there you go and now what is this craziness well first of all we have a parent here and that is the item generator this simply means how basically the item should look like it’s Just going to be a normal item let’s just say please also make sure that this is written correctly it’s not items it is not items with an uppercase i it is item slash generated please make sure this is exactly correct now under the textures right here we have a layer 0 That we’re defining basically we’re just defining the texture of this particular item and it’s going to be under the tutorial mod namespace so this is our mod id again and then colon item raw tanzanite what does this mean well this means that it’s going to look for a Texture inside of the item folder right so textures textures item item and then it’s going to look for a png called raw underscore tanzanite let’s just add this png as well so i’m just going to copy this over this including all of the code and all of the Json files will be available to you in the description below for download in the github repository individual gist as well and now our item is complete for the sake of argument let’s add another item because some people sometimes have been confused what do i need and do i need a New mod items class of course not it’s called mod items not mod item of course right but whatever the case may be let’s just add a second item so what i’m going to do is i’m just going to select this item over here press ctrl d to duplicate The lines that were selected and i’m just going to call this tanzanite so this is going to be tanzanite and then we have both raw tanzanite and normal tanzanite we still need a translation for this so in the e underscore us.json file i’m just going to do the same thing Right here press ctrl d and then we just need to add a comma over here because they are separated by commas and then this is going to be tanzanite and this is not going to be raw tanzanite but the translated name is also going to be tanzanite for the item models there’s a Very neat trick what you can do is you can just drag the json file into the same folder while while holding control and then it will duplicate the file and then you can just rename it to tanzanite over here and of course here as well renaming it to tanzanite so now it’s Going to look for a texture instead of the textures folder instead of the item folder that is called tanzanite.png so we’re just going to copy this over as well this is of course also available for download and there we go that’s how easy it can be to add a Second item to minecraft as well now let’s just jump into the game and see if it works and then we’ll also add a custom item group after that as well but first let’s see if it works or it finds us in minecraft so let’s just take a Look in the miscellaneous tab at the very bottom and there we go some raw tanzanite and some normal tanzanite so exactly how you would expect it to be added it is added and everything working great right now let’s take a look at the custom item group as well this is Actually fairly straightforward all things considered so in our item package we’re going to right click new java class called the mod item group and then instead of there we’re just going to make a new item group so it’s going to be a public static final item group from right here of We’re just going to call it tanzanite and this is equal to a new fabric item group builder over here that build we’re just going to pass in a new identifier tutorial mod.mod id comma and we’re going to call this let’s just format this a little bit differently something Like this we’re going to call this tan the night after the first closing parenthesis comma and then a supplier of a new item stack and then passing in mod items.tanzanite ending everything with a semicolon and there we go now what is this crazy item stack over here well this just Determines the actual item that is displayed for this particular item group that’s pretty much all that there’s to it if you want a second one right you can have a so what you can do then is you can just once again duplicate all of this and then you can have it and then You can have a second one right tens of knight two tanzanite two that’s fine as well but in our case we don’t need this we’re going to be fine with one and now in the mod items instead of passing in the item group here we want to say mod item group Tanzanite and then we’re going to do the same thing right here more item group that tanzanite there you go we can now remove the import over here right let’s also add the translation for the tab now this is actually going to be fairly straightforward is itemgroup.tutorial mod dot tanzanite Colon and then of course once again we’re just going to call this the tanzanite tutorial tab so ttt that’s great now what you will notice is that the item group over here actually has an uppercase g i’m honestly not sure why that is the case it is the only thing i Believe that has an uppercase character in the entire eonscrew.json file so who knows but whatever the case may be this is what we need and now let’s go into the game and see if it works or it finds us back in minecraft again and let’s Just see so this is a very good sign we already have the arrows over here get to the second page and there it is the tanzanite tutorial tab exactly how you would expect it to we have the raw tanzanite in there and the normal tanzanite as well and that’s how easy it Is to add a custom item and a custom item group minecraft and that will be it for this tutorial right here i hope you found this useful and you’ll learn something new and i’ll see you all in the next tutorial so yeah Video Information
This video, titled ‘Minecraft 1.19 Fabric Modding Tutorial | CUSTOM ITEMS | #2’, was uploaded by Modding by Kaupenjoe on 2022-06-15 13:59:48. It has garnered 34870 views and 636 likes. The duration of the video is 00:12:46 or 766 seconds.
In this Minecraft Modding Tutorial, we are adding custom Item to Minecraft 1.19 with Fabric! 🙂
== MINECRAFT COURSES == ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 *
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Fabric-Tutorial-1.19/tree/2-items Gist: https://url.kaupenjoe.net/yt331/gist Assets: https://url.kaupenjoe.net/yt331/assets
== TIMESTAMPS == 0:00 Intro 0:20 Creating the ModItems Class 3:50 (IMPORTANT) Creating the Assets Folder Structure 5:24 Adding and Explaining the JSON Files 8:44 How to add a Second Item 9:53 Demonstration 10:08 How to add a custom Item Group to Minecraft Fabric 1.19 12:15 Demonstration No. 2 12:36 Outro
== TAKE A LOOK AT MY COURSES WITH COUPON CODES == ▶️ NEW Forge Modding with Minecraft 1.20.X: https://url.kaupenjoe.net/CourseForge120X ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 * ▶️ Complete and Roblox Lua Game Development: https://url.kaupenjoe.net/RobloxCoupon *
== 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.
== ADDITIONAL CREDITS == Outro Musik by Kevin MacLeod: “That’s a Wrap” Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 3.0 http://creativecommons.org/licenses/by/3.0
== 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