Hey what’s going on guys totally here and welcome back to another minecraft modding show for version 1.16.4 in this tutorial i’m going to be covering something very simple and very basic and that is items now before i start i would just like to mention that my discord server is in the description And in there you can get help with any of your problems and you can use our bots and you can talk about the currently running competition and a lot more goes on in there as well so yeah just like to mention that apart from that I think we can go ahead and get started so in the last video we went ahead and basically created the base layout for our mod and now we’re going to use that layout so let’s first go into core init and we’ll go into uh item in it In here we want to go ahead and create a deferred register now a deferred register is basically um it’s basically an object that you you register stuff to it um it’s quite hard to explain but i will try and show you instead so what we do is we create a public static final And that will be a deferred register and you can just press ctrl space to bring up this nice little menu right here and for the generics this takes in a um well basically the type that you want to register so i want to register an item and we basically use deferred registers To register most things in the game so as you can see here there is an example of how it exactly works so i’m going to actually call this items because this is our items registry and this will be equal to deferred register dot create now this will take in First the registry so the registry for that we use forge registries dots and then and for items we choose items and then we just need to put in our mod id which we created as a static field in our main class so that will be tutorial mod dot mod id Actually we didn’t create the mod id of course so in our main class we can go ahead and create a public static final string and this will be mod underscore id and that will just be equal to our mod id so tutorial and actually make this a little bit Better we can pass that into here and instead of hard coding it everywhere so tutorial mod dot mod id just like that now if we go back into our item in it we should see our mod id pops up which it does and there you go that is that is the deferred Register but that doesn’t actually do anything we have we haven’t done anything so we actually need to now register it and the way we do that is via a registry object so this basically holds um the item until it is registered where it holds it after it’s registered as well um but This registry object can be null or it can hold null until it’s actually being registered so we create a public static final registry objects and this once again just takes in the type that we that this object will hold so that will be an item and i’m going to call this Example underscore item and that is just going to be equal to um items dot register so obviously items here being the deferred register up here so we call the method that that has and as you can see here this takes in the name so this needs to be all lowercase Uh it needs to be um it cannot have any special characters it must be your case so basically this will be what the name of our item is in game so i’m going to just call this example underscore item so we use underscores instead of places instead of spaces I can’t speak today for some reason and there is an underscore here but it’s not showing up because well i actually don’t know why it’s not showing up but there is an underscore there you’ll have to trust me and then we use a supplier of a new item And once that loads that takes in a properties so for the properties we just do a new item dot properties and once you’ve done that you now have an item now to obtain this item in game you will have to slash give um so let’s say we want it in a Creative tab what can we do well what we can do is after the properties right here we can do dots and then you’ll see all these different um properties that we can add to this item so for this video i am going to just be covering group So that will be the item group um item groups are just creative tabs in the code they call them item groups so that’s basically what they are in the advanced item videos in which will be coming shortly after this one it will come after the block Video um we will go ahead and just cover some of the other ones but for now we’re just going to use dots group maybe dot group and for this we just use item group dots and then these are all the different creative tabs so for this one i’m just going to put it In misc which is the miscellaneous creative tab and that is it we now have an item except if we load into the game our item will not exist because we aren’t this this deferred register isn’t being registered so we have to register the deferred register which is a bit confusing And a bit of a tongue twister but it’s actually very simple to do so we just need to go into our main class and in the constructor below this method right here we can go ahead and actually create a field for this so this returns an i eventbus So we can just go ahead and create a field for that since we’re going to be using it a lot and i’ll just call this bus and we want to set it equal to that and then that means we can just do bus dot add listener there And we can also use iso minutes dot items dot register and you’ll see that takes in a i event bus which will be the bus and that’s it we now have a red uh an item registered however it’s not going to have a texture it’s not going to have a model And it’s not going to have the name that we want it to have so uh inside our source main resources that is where all our assets will go so we need to actually create an assets package in here make sure you spell assets right i very commonly see People will put like um assess or um attacks and silly little things like that um typos like that are quite common so if you do get a texture error make sure you check your spelling it’s very important that you get everything spelt right and this must be lowercase everything In the assets must be lowercase then we create a new folder and this will be dots and then our mod id which as we did in the first tutorial was just tutorial now yours probably will not be tutorial and you can check in the main class right here so ours is tutorial Then we want to create three packages in here we want dot models also want dot textures and we want dot lang now let’s just go through these so the lang will basically be for all of the language files and this is where we set the name of our item what we want the Name to look like in game uh since we obviously can’t put spaces or any special characters in the item in it so we have to specify it in the lang and this obviously allows for localization so you can have it for different languages now to do this you just create a new File in here and this will be en underscore us or gb or um fr underscore fr or whatever um just make sure it is a valid country code dot json and in here we just need the object and then we have our json so this will be um Item dots and then our mod id so tutorial dots and then our item name which was example underscore item now once again this is something you do need to make sure you get correct otherwise it’s not going to work now in this uh second string here in the value Um we it’s basically what you want this item to be called so mine is just going to be example item and obviously you can put whatever symbols in here you want as well if you want to have symbols that is just where you localize it obviously if you then want to do another Language you simply just create a new file so fr underscore f r which will be the french one um i think you can also have uh c a underscore f r which is like uh canadian french i think that might be completely wrong but i can have For example ian underscore gb dot json which will be the great british um lang and in here we once again just have the same thing so item.tutorial mod dot and then our item name so example item and then we can just call this example item obviously for things like this it’s Going to be the exact same but yeah pretty pretty simple i’m actually going to delete that gb one because we don’t need it okay then we have the models so this is where all the models for our items and our blocks will be so in here we can create a new package And we can call this dot item make sure it is singular not plural and i’m also going to create a another package for dot block as we’re going to have block models in the next episode as well so in our item package we want another file and this will be um For our item our item model so this needs to be once again the name of our item so example underscore item and if you get this wrong if you if you get this name wrong then it’s not going to work so you need to make sure That you get it the exact same as what you named it in your item in it so that is a json of course and in here um you can go ahead and get this file which i have in the description and this is just a template for your jsons Your item model jsons so i’m just going to run through this json really quickly it’s a very simple json so we basically have the parent right here which is what this item model will parent off of and we just want a generated item which is the plain item parent And then we define the textures obviously you can have multiple layers which is why we have layer 0 right here and obviously if you wanted let’s just say layer 1 then we can do blah blah blah but i will be covering that in a future tutorial and this just specifies the path of Where the texture is so it starts so it knows it’s in assets so we don’t need to specify assets so we start from our mod id which is tutorial and then we put a colon since everything after that it knows it goes into textures so we don’t need to specify textures then We have to specify that it is in the items section of textures which we’ll create in a minute and then it is the item name that well the texture name um we don’t specify the file extension because it already knows it is a png so let’s just exchange some of these little Values out so obviously our mod id is tutorial and our item name um i’ll create that in a second i’m just going to create the package for the textures so we have items make sure these are plural it’s very important these are plural and then we have blocks and i’m also Going to create another one actually for um entities actually i’ll create another one as well um for gui’s and we will be using those ones in future tutorials so now we can go ahead and create our texture now on my um on my desktop i have the texture i’m going to be using I’m a professional artist of course as some of you may know so this is going to be a very well made texture um i definitely put a lot of time into it you can see i have it named yellow thingy so what i could do is just put yellow thingy However i am actually going to rename this it’s better to keep it the same name so we don’t get confused with um what jason it belongs to and don’t mess that up so now we can just put example item since our texture is named example item in the items Package so yeah you can have it in a package called item instead but just to make sure um that we’re not getting confused between our models and our textures i prefer to have textures as plurals and have models as singulars it just makes more sense If you wish to do it if you wish to having both singulars that’s fine but this is just how i intend to do things it’s a lot cleaner and it stops people from getting too confused now i would like to mention if you dragged in a texture into the actual file system So if you dragged it into source main resources assets tutorial textures items if you dragged it into here instead of into eclipse you will need to actually go ahead and right click this assets and go ahead and just refresh and that will make sure it updates Now that is actually it for this items tutorial we can now go ahead and run the game and we should see it working okay so as you can see i am in the game and if we go into the miscellaneous tab which is where we set our item we can see our example Item and if it all worked we should have a texture working perfectly fine now if you do have a purple and black checkered pattern make sure you read the latest dot log and i will show you where that is so if you open your file system and you open your mod folder And you just go into the run folder and you go into logs and you just want to give it a refresh and yeah that should be pretty much it um i mean yeah if if it doesn’t have a name just make sure that your lang file is in the correct place So that is obviously assets dot mod id and then lang and then in underscore us.json so that is it uh for this one um in the next one i’ll be covering either blocks or advanced items i’m not sure which i’m doing first but um yeah So i will see you guys in the next video good bye Video Information
This video, titled ‘Creating an Item – Minecraft Forge 1.16.4 Modding Tutorial’, was uploaded by TurtyWurty on 2020-12-24 18:30:11. It has garnered 35121 views and 854 likes. The duration of the video is 00:20:21 or 1221 seconds.
In this tutorial, I cover creating our own item with its own texture and name using the Forge Modding API.
|| Important Information || My Discord Server: https://discord.gg/d5cGhKQ Template Item Model JSON: https://pastebin.com/tNeZCAYd My GitHub: https://github.com/DaRealTurtyWurty/1.16-Tutorial-Mod