Hey guys it’s Thomas here we took no vision and welcome to the next part of our Minecraft modding tutorial series for 1.15 in this episode we’re going to be creating a custom basic armor set and this process is very similar to tools so if you did okay on that video then you Should be fine here it’s just a lot more values that you need to sort of understand and research before you really make your armor set but we can get right into it so the first thing you want to do just like with tools is we need to create a custom material type Just like tools every armor set full set has a a material tier that it draws from to get it to values like how much damage it reduces the durability and stuff like that so we need to make one of those and we can come over to our main package Here tutorial right click new create a new package and we want to name this just armor and just like with tools this will hold more stuff later on but for now it’s just gonna hold our our tier that we’re gonna make so inside of your armor package here you want a new Java Class and make sure it’s an enum not a class and in this enum we’re gonna name it mod armor material I know see why in a second but add that to the repository now first thing in this class to do is to make sure it implements eye armor Material so what this is doing is getting all of the methods from eye armor material and that’s what we’re calling it mod armor material because it’s just an extension of the interface here so hover over this red line and make sure you hit implement methods and that’s gonna get all of these methods Here that we can hit okay on and they’ll all get set up in the class here now we have to set these up ourselves because a lot of them are just going to return basic values like zero or null so that’s what we’re gonna do right now now the First thing we want to do before we actually you know set up these values is make sure that they’re assigned to variables so let’s create some data members we can get rid of this semicolon here so first data member we need is a max damage array so we can type private Oh that’s not useful private private static final int array and this is going to be named it’s static so all capitals max underscore damage underscore array we want this to equal a new integer array and we’re actually just gonna add some values in line here so just create Some curly braces and we want the first value to the 11 the second value to be 16 the third value to be 15 and the last value be 13 and I will explain what these values mean a little bit later because they’re not gonna make much sense now but essentially each slot in This array is going to represent a different armor piece in your set so I believe and this could be incorrect but I believe this is the helmet here then chest plate leggings and then the boots and each one of these values is going to determine the base level for your Durability for those pieces and we’ll be adding some more to that later so just keep that in mind but the next value we need is a private final string name this is just the name pretty standard then we need a private final integer and we’re going to name this max damage factor now We’ll be sending this later and these will all be read because we haven’t created the constructor yet but we’ll do that later the max damage factor is going to be essentially multiplied into these values to determine the durability of the piece so that’s what that is used For next one we need is a private final integer array and this is going to be the damage reduction amount array you can name it whatever you’d like but I think that’s the most clear and this is essentially going to be very similar to this except instead of durability it’s Going to hold the the armored slots that each piece gives you so if you know that little bar above your health bar the armor slot bar this is going to determine later on how many slots in that bar it fills up we can move on to the next one so private Final int and chance ability just like last time with our tools every piece has an enchant ability value to get rare and chance then we also need this is different for the first time I don’t think we’ve ever seen this private final sound event I’m rich gonna name the Sound event now this is gonna be what determines what sound plays in the game when you equipped your armor so it doesn’t have to be the basic armor sound it can be something crazy if you want but we can set that later next one is going to be a private final floats and We’re gonna call this toughness and this value is going to affect this value right here it’s going to essentially take these values up a notch depending on how high you want to set this toughness it just increases the protection overall and you can set this To zero to disable it as well and then the last one I know there’s so many data members with last one is privates final and just like with our tools you need a supplier ingredient ingredient and we’re going to name this repair material just like last time and we can make sure to Import supplier from Java util dot function and this is gonna essentially be the just like last time the material that you use in an anvil to help repair your items okay so now we can make our constructor then we can just call it mod armor material and this is gonna pass in All these values except for the static one so string name int max damage factor int array damage reduction amount array we’re literally if you if you are following just copying these values right here bear with me sorry there’s so many int and chance ability then I’m gonna make a New line just so you guys can see it on screen sound event sound events comma floats toughness comma supplier ingredients and we’re just going to name that repair material like last time and then add some curly braces and last thing we need to do with these data members is just Assign them so again we’re repeating all of this like from the tools episode this thought name is equal to name this dot max damage factor is equal to max damage factor and so on and so on this dot damage reduction amount array is equal to damage reduction amount array Um this dot enchants ability is equal to enchant ability this dot sound event is equal to sound events this stock toughness is equal to toughness and the last one this dot repair material is equal to repair material alright so that should get rid of most of the errors now We do need to make our enum but we can do that right now I think I guess well we’ll come back to these later let’s do our enum first so just like with the tools that we made you’re gonna make a new enemy types Or every or an enum value I guess is the correct term for every single armor set so for our Ruby set we’re gonna have one enum called Ruby that affects all of the Ruby armor pieces that we’re gonna make so we’re just gonna call this Ruby and We’re gonna pass in all the values that we set here pretty much I know it’s a lot but we gotta get through all of them so first value name is not just a standard name like the name of your item it’s actually gonna affect the name of Your layer and we’ll talk about layers later but layers are essentially the the texture for what like goes on your body if with armor so you want this to be your tutorial mod ID so access your mod ID from your main class and then just Add with a plus sign a colon and then the name of your tier here in lower case so in my case is Ruby so I’m just gonna put Ruby in the lower case and what this is gonna do write a comma there what this is gonna do is make sure I’ll just Write it out so you can see it that the pathway to your layer which will deal with much later on we haven’t even talked about that yet is gonna be Ruby underscore layer underscore one and Ruby underscore layer underscore two so it’s affecting this value right here if you wanted you could Make this Ruby underscore armor and that would make these the path to this Ruby underscore armor underscore layer but I don’t think that’s necessary because it isn’t a folder called armor so we kind of know it’s armor so I’m just gonna leave it to Ruby alright so that’s the Name and the next thing we need to do is the max damage factor now again this is what is multiplied into this array to set the durability so just for some examples irons max damage factors 15 diamonds is 33 we’ve got gold at 7 and I Believe leather is 5 so and also chain is the same as iron’s 15 so what this means I’ll just get out my calculator real quick whatever you set here just for example let’s say let’s say our head our headpiece our a helmet here so our Helmet has a max damage array a value of 11 so if we set this to 15 we can do 11 times 15 to see that our helmet is gonna have a durability of 165 so that’s kind of how you determine what the the durability is and we’ll do this equation Later on and with get durability but just know that that’s what this value is doing and these values don’t have to be these base values don’t have to be what I’ve said here this is what vanilla minecraft has but if you want you could set them to whatever you’d like but I Would recommend leaving them like this just so it’s it follows Vanilla’s mechanics alright so 15 is the the iron max damage factor I want mine to be between 15 and 33 because that’s between iron and diamond so I’m gonna make mine like 25 all right so the next one we Have to do is the damage reduction amount array this is going to be an inline array some new integer array and we can just instantiate it in the line with some curly braces and we need four values again one for each armor piece so the first piece is going to be your Helmet and each value in this like I said before is going to be what how many armored bars you get on your on your character how how much your armor protects you so I’m gonna set the helmet is to the leggings is the second one I know it’s kind of confusing you to Think the chest plate would be the second one but it’s actually the leggings I’m lugging this is gonna be five I’m gonna make the chest plate six and the boots too so what this is gonna do is have it be so that if you equipped the Ruby helmet you’ll get a single bar Of of armor because all these values are going to be divided by two in the game so you basically all these values divided by two is gonna be what’s in the game for your armor protection value if I were to equipped a chest plate I would Get an armor value of five divided by two which is like 2.5 or so so I know that’s six but you know it’s close to that number so that’s sort of what you’re working with here for reference this is the base armor values for iron so and I believe diamond is a little Just a little bit higher than this for a couple so that’s sort of something you can play around with yourself next value is the enchant ability again this just affects how rare the enchants you can get with your with your items in an enchantment table I’m gonna set mine to 18 just so it’s a little better than the tools but it’s you know pretty similar to what most of the vanilla ones are I believe diamond just ten and gold is 22 just for reference all right so next is the sound event I’m gonna make a new Line here so that we can see it on the screen so to get a sound event you want to type sound events dots and then you’ll see all these different sounds again this is the sound that plays when you equipped the armor with your your right hand so let’s just make it item Underscore underscore armor equips generic Farmar underscore equipt underscore or generic there we go so this is just the generic item armor equip sound there are ones for unique types that you can make and we’ll be talking about custom sounds later but for now I would just probably set it to The generic sound so it’s you know simple now the next one and arguably the one that has the most effect on protection is toughness now toughness is very confusing at first because when I first learned about toughness I was like what’s the point it doesn’t really seem to do much but it Actually is very important so toughness basically takes all these values here and just ramps them up another tier so if we were to set this toughness value to like 2.0 F what this would do is it wouldn’t multiply these values by two in fact these are gonna actually remain the Same these values but the protection you’ll receive from these values is going to increase dramatically so what diamond does is it actually keeps very similar values to what iron has in terms of its damage reduction amount array but its toughness is set to two and that’s why it’s so much better Than iron so I’m going to set this to zero actually and by setting it to zero we can actually disable this from our armor and make it so that there is no toughness factor and just for reference I believe every single item or every single armor set in the game doesn’t Have or has a toughness of zero or does not have any toughness at all basically except for diamond and maybe nether right in the new version so yeah just keep that in mind it’s just diamond that really has toughness I believe but I’m gonna set mine to zero because I don’t Want it and but just know that the higher this number is the the more the armor will protect you and the next and final argument to pass in is the repair material and we can get this just like last time with a lambda statement so making a quick lambda statement there With an arrow and we want to curly braces because we are going to return an ingredient return ingredients dots from items and then we want to get the item you used for the most part to craft these items so registry handler Dodd’s Ruby gets and make sure that you add a Semicolon at the end of this line as well and a semicolon at the end of this you know now just to sort of clarify what this is doing this is setting the item that you use to repair in an anvil in vanilla minecraft you can put iron Ingots in an anvil to repair iron tools and armor and what we’re setting here is saying you can use rubies for the same purpose for Ruby tools so that’s what it’s doing I did mess up in the last video with tools by saying that you set this to Ruby underscore sword that was Incorrect vanilla minecraft does that for you anyway so make sure you set this to whatever is like the main ingredient in your crafting recipe for for your your armor piece and same for tools as well alright so our enum is actually completely done so all we have to do now Is set these methods so for durability we’re gonna have to do a little bit of math it’s not too hard but we do need to multiply the max damage array slot by the max damage factor just like we talked about earlier so we can do that By getting the max damage array and then accessing the slots in dot get index and we want to multiply this value with them multiply symbol by this dot max damage factor and again just one more time to explain what this is doing is multiplying this value right here this Max damage factor by each corresponding value in this this array here alright so next is the get damage reduction amount this is just gonna be this dots damage reduction amount array and then we’re just gonna get the slot index so slot in dot get index and now for enchant Ability this one’s super easy just this ton chance ability you don’t even need to add the this it’s just sort of good coding practice I guess for sound event or get sound events same thing this tile get sound events or I guess just sound events we don’t need to use the method And then for a repair get repair material same thing this dot get repair material or repair material I keep wanting to say gets don’t do that get the the variable and then dot gets because this is we need to get the ingredient we don’t want the supplier Now forget name we’re gonna do this dog name and forget toughness we’re just gonna do this dot toughness just like last time okay and last thing you need to do is make sure that this is only access to client side otherwise you might have some issues so to do that Just add add symbol only in and then in some parentheses we want this dot client and make sure that you import dist as well as only in there we go so that’s going to make sure we only access this value client side and now we are actually completely done with our mod Armor material class and remember that if you want to add new materials here for new armor sets all you have to do is copy this line right here paste it down below change the name of something else like quartz or whatever your new armor set is and then change all of these Values accordingly as you see fits but yeah that’s it for the the material so now let’s head over to our registry handler class and right below tools we’re gonna make a new section here just called armor and this is same sort of thing like last time just a lot of busy Work we’re gonna have to make five or sari for armor items each individually and it’s very similar to what we did with the tools and you’ll notice that this class is getting kind of cramped if you feel like you have too many objects in this class feel free to make multiple Classes for your items you can have a full class dedicated to armor another one two tools I’m just putting them all in one class so you can see them but just know that you’re totally free to do that and it’s actually preferred I think but let’s get started so public static Final registry objects and again this is going to be parameterized around armor item because it is an armor item and the first room we’re gonna make is our Ruby underscore helmet this is gonna equal items dot register and we’re gonna have to pass in the name just like last time so ruby underscore Helmet a comma and then a lambda statements with a quick arrow and I’m just going to come down to a second level here just so it stays on screen but we need to create a new armor item and this is gonna pass in three arguments first one is going to be the Material which is what we just created and we can access that by typing mod armor material dot and then you will see all of your armor materials there for our case we’re using rubies so click Ruby comma and then the next argument is going to be the the slot type so this is What type of armor piece it is so you can access this by doing equipment slot type equipment slot type dots and you’ll see there’s chest feeds head and leggings as well as main hand and off hand for now we’re going to be focusing on these four so first one is gonna be Head because we are doing a helmet here and that’s gonna make sure that this piece only is allowed to go in the helmet slot and then the last argument we need to pass in is just like last time our group so new item properties dot group and then we’re just going to set It to our tutorial tab or whatever your main class and your custom tab is or again I’m just gonna repeat this one more time if you want to do vanilla tabs you can just do item group dot and then access of vanilla tab but I’m gonna do My custom one all right so this Ruby helmet is done and we just need to do this three more times with the three other armor pieces so let’s copy this paste it below let’s it’s gonna all going to be armor items regardless of what type they are so keep that the same But we want to change the name here for Ruby helmet to ruby chest plate and then same here change this to chest plate and last thing we need to change is the equipment slot type to chest and then again repeat the same process but four legs so ruby underscore leggings and Then same here instead of helmet we want leggings and instead of equipments law type dot head we want dots legs and then one final one for the boots change helmet see boots change how many here two boots as well and of course we change head to feet all right so our Actual items are done now we just need to make the J sons to assign the texture and then add the textures and do bare with me because this is going to be kind of a long process there’s a lot of stuff to go through so first thing we want to Do come over to your resources folder assets your mod ID and then go to models open that up an open item now this these items are just like regular minecraft items so you can actually just copy your Ruby item Jason and rename it but I did Include in the description a link to a paste bin that has just you know the JSON so in case you haven’t made an item yet that’s what you can use but I’m just going to copy our Ruby item here Ruby Jason paste it in and just I’m going to name it Ruby underscore helmet refactor and add and make sure that you change the name here of course from Ruby to ruby underscore helmet and make sure your mod ID is correct as well now we need to do this for pretty much every single armor piece so copy Ruby helmet paste change It to Ruby chest plate and add and then again change helmet to chest plate and the same thing paste again change it to leggings refactor add and then change helmet to leggings and then final one we have to paste an item and change helmet again to boots your Factor add and then finally change helmet to boots alright so now we have in our our models Don item we have our Ruby helmet or Ruby chest plate Ruby leggings and Ruby boots all for Jason’s and they should all have their corresponding names all correct Inside of him ok great so we can close all these files save all now we need to do the textures so there’s two types of textures for our armor I mean come to the desktop here and you’ll see that well we have the regular item pieces These are what you’re gonna see in your hand and your inventory for like the helmet the chest plate the leggings the boots just standard minecraft items and you can make these just like you’ve made every other regular microphone 16 by 16 the second texture type is going to be the layers now these Layers are what you see on your character in game when you equip the armor and same with mobs I believe so this is going to follow a very special format that you need to keep pretty much the same otherwise it’s not going to work so or it will look weird pretty Much so what you can do if you have never worked with these before is you can either get them from the base vanilla minecraft files and just edit them that way or you can come to the description and I’ve got two links one to each imager post that has a a Template here that basically just outlines what you need to color in and the rest will be transparent so just fill in these blank spots with whatever you want and that will be your armor piece in the game armor layer one is going to be the head chest and boots and Armor layer two is just going to be the leggings I’m pretty sure that’s the case so yeah in case those are helpful check those and to make sure that all of your Ruby items here are named again exactly the same name that you have here and you Want this is very important you want your layer one here the one with the helmet and the chest plate and the boots you want to make sure that’s equal to the name that you set in your armor material right here it has to be this name underscore layer underscore one and Then same thing with this one for the leggings that name you set underscore layer underscore two very very important so once you have these all created go to your microphone a folder tutorial mod source main resources assets tutorial textures items and you want to drag all Of your item textures in and go back to textures and we want to create a new folder in here in textures and you can do this in IntelliJ if you want and we want to name this folder models and instead of models we’re gonna create another folder called Armour and inside Of this folder so it’ll be textures models armor you want to drag in your two layers and we can see this in IntelliJ if we come back here let’s go open up textures here so now when we’ve got items we’ve got all of our Ruby items here and then we’ve also got our New folder called models and we’ve got our Armour folder here and inside of there is our two layers our Ruby layer one and a Ruby layer two alright so those are all done now all we need to do is set the the language so open up your Lang en underscore Uwe saw JSON and we can just copy one of these items here on a comma and create a new entry item dot the name of your mod ID and then of course the name you sets where is it right here Ruby underscore helmet so Ruby underscore helmet And of course you want this to be helmet and we can just like literally copy and paste this four times and then change it every time so chest plates hopefully you’re getting used to the rhythm of this it’s pretty much the same process as making any normal item just with a Few extra steps and then boots and we can change the names as well chest plate review leggings and Ruby boots okay so we can file save all and now if we run the game we should see our custom armor set inside the game alright so we’re inside of the game now And we can go to our creative inventory go to our custom tab and there are items our Ruby helmets Ruby chest plate Ruby leggings and a ruby boots and we can go to a survival mode here game mode of survival and we can put on these items Just like any regular item and I don’t know if you can hear the sound let’s turn it up a little bit just in case you can but if you equip this armor piece there should be a noise hopefully you heard it if not I’m not too big of a Deal but it should be working fine the noise and as you can see we do have a the exact amount of armor slot pieces above our our health bar here that we set in the the code so it is working perfectly and we can test it out really Quickly by just spawning a spider here I’m just having an attack us a few times and you can see it is definitely protecting us as much as say you know an armor an iron armor set wood so that is working great and I can just kill the Spider a must when you want to test is our armors a little bit damaged here we can take it off go to a an oval here put one of our pieces in and if we put some rubies in you can see that we can repair our armor with the rubies so just like Vanilla mechanics you have a custom armor set now really quickly before the video ends I just wanted to mention that I will be linking another MC creator wiki article in the description I know we’re not using MC creator but this wiki just like with tools is so helpful Because it really shows all the parameters in one place and gives you some foundational knowledge so I highly recommend checking if you were a little confused when you were trying to make your mod armour material type alright so that’s gonna do it for this video thanks guys so much for watching I Hope you learned a lot about armor sets and I will see you guys in the next episode Video Information
This video, titled ‘Minecraft 1.15.2: Forge Modding Tutorial – Custom Armor (#8)’, was uploaded by TechnoVision on 2020-07-09 23:40:17. It has garnered 18330 views and 649 likes. The duration of the video is 00:29:50 or 1790 seconds.
Learn to code a Minecraft mod from scratch in this complete tutorial series! In this episode, we create a custom armor set, each with some unique material properties.
— Important Links —
● Armor Item JSON: https://pastebin.com/cgjqrfSy ● Armor Layer 1: https://imgur.com/a/sxoYnc3 ● Armor Layer 2: https://imgur.com/a/GAxwBha ● Armor Properties: https://mcreator.net/wiki/how-make-armor
● Discord: https://discord.gg/ZsB3Eha ● GitHub Repository: https://github.com/TechnoVisionDev/Minecraft-1.15.2-Modding-Tutorial.git
— Music —
● Chill Out Media – Minute Mix
— My Channel —
● Subscribe: http://tinyurl.com/zbc7mwy ● Instagram: https://www.instagram.com/tomm.peters ● Twitter: https://twitter.com/TechnoVisionTV
#minecraft #modding #tutorial