Hello and welcome back to another tutorial in this tutorial we’re going to be creating tools and armor so in order to create tools and armor we’re going to need to create materials for each one so under common let’s go to new package and call it dot material and Here i’m going to create a new class called custom tool material however this isn’t going to be a class this is going to be an enum and this enum has to implement i item tier so next let’s create a private final int called harvest level then let’s copy and paste this a Couple of times let’s change this to max uses then we need efficiency and attack damage and enchantability mining speed and attack speed are going to be both floats and then we need an ingredient repair material so next let’s hover over custom tool material and add unimplemented methods forget max Users we’re going to return this dot max users same for efficiency and for attack damage harvest level enchantability and repair material next let’s create a constructor of custom tool material and here we need the mining level the max uses the efficiency and the attack damage we need the Enchantability and we need a supplier of ingredient called repair material we can press ctrl shift o to import supplier from java.function.util.supplier then we can set this dot harvest level to max harvest level max users this dot efficiency to efficiency this dot attack damage to attack damage this dot enchantability to enchantability And finally this dot repair material to material dot get so to get rid of this error up here i’m going to create a custom tool type so let’s call this example tool then we can add arguments like so and then we’ll add a semicolon at the end of here So first we need the harvest level i’m going to set this to 4 then we need max uses i’m going to set this to something like 4000 which is the durability of the item then we have the efficiency which i’m going to set to 15f which is slightly higher than diamond For attack damage i’m going to put something like 2f and for enchantability i’m just going to put 17 and now we need to supply the custom ingredients so let’s create a supplier and then let’s call ingredient dot from items and then we need to give It some items so i’m just going to add item init dot example item dot get then let’s import item in it and that should fix all the errors if we want to add another tool we can put a comma at the end of here paste this in again and then change this something So like example tool two now let’s create our armor material so let’s right click on material go to new enum custom armor material and this is going to implement eye armor material let’s add unimplemented methods so up here we’re going to need a private final string called name a private final int Durability multiplier private final int array armor vowel private final int enchantability private final sound event equip sound private final float toughness another private final float for knock back resistance and finally a private ingredient repair ingredient and then we can create a public static final inter array called Base durability which is going to have these four values inside of it then in here we can just rename this to slot and then we can return this dot base durability index slot multiplied by this dot durability multiplier however we can’t use slot here so we have to type dot get index To get this top damage reduction amount we can change this to slot and then we can return this dot armor values index of slot dot get index then we can return this dot enchantability and here we can return this dot repair ingredient and in the name We can return this dot name finally for the toughness we can return this dot toughness and the exact same thing for knockback resistance with the return this dot knockback resistance now we need to create a function to initialize all of these so let’s create a constructor Which is going to take a string name int durability multiplier int array armaval int enchantability sound event equip sound float toughness float knockback resistance and a supplier of ingredient repair ingredient and we want to make sure to put the supplier from java.util.function now inside the constructor we can do This dot name is equal to name this dot durability multiplier is equal to durability multiplier this dot armor valve is equal to arm of al this dot enchantability is equal to enchantability this dot equip sound is equal to equip sound this dot toughness is equal to toughness this dot knockback resistance is equal To knockback resistance and finally this dot repair ingredient is equal to repair ingredient dot get and we want to make sure that this is also final now up here we can finally initialize the armor so let’s do example armor and then we need to give it the name so I’m just going to do example from there the right this would be something like netherrite then for the durability multiplier multiply all of these values to get the durability i’m going to multiply them all by 10. then we need a new int array which is going to Hold the armor values so i’m going to do booze i’m going to give me 4 armor leggings are gonna give me seven chest plates gonna give me nine and helmet is going to also give me four then we’re also going to have an enchantability of 17 And for equip sound we’re going to do sound events dot and here we can write our sound event which is going to be played when we equip and if we go into the sound events class you can see we have all of these so we have the turtle netherright leather iron gold Generic elytra diamond and chain i’m just going to use the generic one but you can use something else for toughness and not back resistance i’m going to return 4f and 0.2f and then finally we need the ingredients so just like in our tool material we i’m going to use the example item so Let’s just copy that and paste it into here now let’s go into our item init and register an item with the materials let’s do a public static final registry object of item i’m going to call this example sword is equal to items dot register example sword and now we need to supply the Sword item so let’s create a new supplier of a new sword for the material we can do custom tool material dot example tool then we need to give it the damage and the attack speed which i’m just going to put as six and minus one here we need the properties again so i’m Just going to copy these properties over to here like so and just like that we have an example sword i’m actually going to copy this five times for the ax pickaxe shovel and hoe and i’m also going to rename these things on the right and then afterwards you can change the Damage and attack speed values as you wish i’m going to leave them here for now for simplicity’s sake but you can change these yourself if you want so now let’s create the armor so let’s just copy this down here and i’m going to call this example helmet and let’s set it to Items dot register example helmet and then we need a supplier and then we give it an armor item and for this we need the material the equipment slot and the properties for the material we can do custom armor material dot example armor then for the equipment slot we can do equipment slot type Dot head for the helmet and for the properties we can just copy paste this once again and that’s it for our armor so now we can copy and paste this three more times change this to chest plate there’s two leggings this to boots and the same over here This equipment slot type is going to be chest this one’s going to be legs and this one is going to be feet and that is it for all the java code now we need to make the jsons so i’ve gone ahead and filled in the lang file For all of the items and next we need to make the item models so first i’m going to start with the armor because that’s the easiest so we can just copy the same generated item as our example item but just change the name and the layer Texture and we can do the same thing for the chest plate leggings and boots just like so and then we can create the tool model so let’s just copy our item again change it to example sword and change this item to an example sort but this time we’re going to change item Generated to item and held and we need that for all of our tools so now let’s just copy and paste this five times for our other tools so now we have our sword axe hoe pickaxe and shovel then in our resources assets we need to create a new package called dot Minecraft and in here we’re going to override all the default minecraft layers and as we named it example in here we’re going to need to bear that in mind when we create the name for this json file let’s create a new package called dot textures dot model dot armor like so and let’s Click finish and now we need to find our textures so i can’t really be bothered to make my own textures right now so i’ve just gone ahead and taken the original diamond textures from the game and you can see we also have these layers for the armor model so netherright uses a Slightly different one with like an extended helmet but i’m just going to be using the diamond one so now let’s drag all of these bar the two layers into our textures folder like so and now i’m going to have to go through and rename all of them and now i’m going to take Our two layers and drag them into this folder that we created up here and now once again we need to rename this diamond to exactly what we called our example armor otherwise it just might work so let’s rename this to example underscore layer underscore one and the other one to example underscore Layer underscore two and once we’ve done that we can start the game and now if we load into the game we can see we have all of our knockoff diamond tools here which all have the same attack speed and damage because we haven’t set that yet And these have different armor and if we go and press f3 and h to show plants tooltips we can see that they have different durability if we go into game mode survival we just give ourselves a pickaxe here and use it you can see that it has 4000 durability Like we said in the code and if we press f3 we can see our armor model is also rendering if you need any help join our discord and i’ll see you next Time Video Information
This video, titled ‘Minecraft Modding Tutorial 1.16 | 11.0 – Tools and Armor’, was uploaded by Cy4’s Modding on 2021-03-19 19:28:22. It has garnered 7583 views and 180 likes. The duration of the video is 00:11:56 or 716 seconds.
guess who’s back!
(ɔ◔‿◔)ɔ ♥ ~ expand me
C://Follow_Me/ Subscribe: https://www.youtube.com/channel/UCJIDXtGpf4wv1ybDzdTA_vQ/ Website: https://mcmodding.club/tutorials/
C://Help/ Discord: https://discord.gg/x9Mj63m4QG Or comment on this video!
C://Source_Code/ This Episode: https://github.com/Cy4Shot/ModdingTutorial1.16/tree/main/11.0-Tools%2BArmor All Episodes: https://github.com/Cy4Shot/ModdingTutorial1.16/