Hello hello everyone and welcome back to another modding tutorial audacity get off the screen what are you doing okay so it’s been a long time since the last episode and what am i planning to do this episode let’s let’s see some basic tools yeah I didn’t really come in to Here with much of a plan it’s uh oh it’s been a crazy month I’m very busy at work so I haven’t had a lot of free time but hopefully we can get a little bit done today so yeah let’s do some tools first I would like to address some issues I’ve Gotten many many comments mostly to do with my models that work to which I say might work just fine on one point eleven point two I don’t know what the problem is I’ve literally changed none of my code created a one point eleven point two environment loaded up the one point Eleven code and it works fine so I don’t know double check make sure you didn’t misspell anything make sure you’ve got all the files in the right spot the model system is incredibly picky if you make the slightest error it explodes you need to be very careful when working With models and yes I know these colored blocks are not something we’ve actually covered yet that’ll be in a later video but everything works fine for me so there was nothing that changed for model rendering in one point eleven point two the fact that I was on one point eleven Before is meaningless still I don’t mind trying to help but and the number of errors we’ve had is kind of crazy still I understand I remember when one-point-eight first came out and how I literally spent several days trying to figure out how to get all my blocks and Items to render properly it was a nightmare I admit that okay so I guess we could go ahead and stick with this 1.11 environment or one plot 11.2 have still got one point eleven if I need to cross-reference anything really quickly but considering my level of experience With tools I think we’ll be okay so tools when I say tools I mean a bit more than just the things that extend item tool I also include swords and hoes although it’s kind of debatable so the way minecraft works is so we’ll have a the item pickaxe class for instance and This extends item tool as does I think they use Spade for shovels yes and then we have item axe as well and these all extend item tool you could extend item tool yourself but you’d really be doing yourself a favor if you can extend the vanilla item pickaxe item spade an item Axe classes because then your tools will work with other mods wait tinkers construct does it if you’re wondering is they just extend item tool on everything if I remember correctly they do not extend the nil classes which is white ingress tools don’t really work in a lot of places that other tools will So let’s see um oh and I totally forgot to text sighs again let’s go ahead and bump that up I haven’t had anyone complain about two levels up let’s hope that’s okay because that is really huge to me okay so let’s leave mod items open And okay so we’re going to need to make a tool material and let me go ahead and just make one in the mod items class I suppose so we’re going to create a public static final tool material I think it is yes and to create this we actually need to Do Ingham helper allegedly why do you not like final tool material the name let’s just call it tool material so we need to do ennum helper Am I am I crazy okay I don’t know what Eclipse is doing is confused maybe because this is a new environment but it is enum helper that Ad tool material okay so yeah this is kind of a case where I wish I had something open to reference to creating tool materials is not something I do very often because I don’t really use them for anything it’s just kind of a necessary formality okay So I did actually use my mod ID here so let’s go ahead and do tutorial dot resource prefix and just add I’ll just abbreviate tutorial material there I don’t know why and of course everything is all messed up now okay so we gave it a name now let’s give it a harvest level So in vanilla harvest levels go from zero to three inclusive where zeros would one is stone two as iron and three is diamond let’s just go ahead and give our as a harvest level of four max uses is how much durability it has diamonds about 1561 I think irons about 250 let’s give ours on 2048 efficiency is how quickly digs through materials and if we actually just look at the tool material here it’s not the most readable format here the max uses an efficiency so diamond is 8 so let’s just make ours a bit better Than diamond let’s make it 10 damage is how much damage your deal send to T’s so diamonds 3 will do for enchant ability is how good it is in an enchanting table analysis you do 16 and this autoformat thats little rap on the screen tool material this will tool materials Are a good way to provide basic stats to tools if you’re not doing anything fancy like silenced gems or tinkers construct does using a tool material to set all the properties of your tool is fine however and this is a very big however do not reference the tool material for Anything ever that’s if you’re wanting your mod to say use tools from another mod referencing the tool materials is a very very bad way to get the properties of that tool because like I said not all tools use tool materials and yes that is a big anoints of mine being the author Of silenced gems my tools as you may have seen before use that fake tool material and I set the harvest level to one which is the equivalent of a stone pickaxe so that you can use these in like the progressive automation machines because progressive automations checks The tool material so again it’s a big headache it when mods are checking tool materials like that there are alternatives to that we’ll probably look into that a little bit so just remember that do not check the tool material ever use it to create your tools and nothing else Not I’ve vented my frustration why don’t we create an actual tool class here so let’s go into our create a new class maybe in our item package we’re in a sub package of it so let’s create a tool sub package in there and we will call this item tutorial Pickaxe you start with the classic pickaxe make it extend item pickaxe I guess technically we don’t even need to extend the pickaxe just to make a basic pickaxe let’s actually just go ahead and try to register a pickaxe although I guess now we can still register the model in Everything here so it’s okay so let’s create an item pickaxe call it tutorial pickaxe we will why’s that down here set a registry name new resource location all the usual stuff and I’ll just go ahead and type pickaxe in there for now and registry that register and I do see the Compiler error up there we need to pass that our tool material this is not what I meant to do problem now not visible okay and this is why it’s bad to do things on the fly so yeah we do actually need our custom class so let’s go ahead and do new Tutorial pickaxe and pass it our tool material we could optionally just manually enter it here which I guess is what I’ll do now if you want to use the same class for multiple pickaxes passing them different tool materials you’d probably want to leave that in the constructor Okay so we could optionally give the constructor tool material I’m not going to I’m just going to call super mod items dot anything else go wrong below maude items tutorial material cool material duh should fix everything over here so we now should have a very basic pickaxe It’d probably be good to create some models for it as well so I don’t know if there’s anything special about the the basic vanilla textures and I just have all these extracted to my folder these are from 1.9 but they should still work I don’t know iron pickaxe copy that you Paste you in there item pickaxe up here at I guess that’s okay I mean we’ve got our mod ID prefix so whatever to open that up so we’ve got room for a texture that needs to be in this kind of format you so we’ll just call it X acts and let me grab Grab the gold pickaxe ASAT in TOR extra folder rename it pickaxe oh and in Windows the shortcut for renaming a file is f2 which is how I did that if you’re wondering so I probably should have picked a different color done magic wand the pickaxe head All of it I think those two pixels here count as well okay let’s do control shift you make you I don’t know go with that negative 160 you okay so we should texture and a model in place ready to go Let me go ahead and select a product f-five to make sure it sees the new files that were created outside of Eclipse and let’s go ahead and try running it see what happens and yes I know I’m being kind of bad by not really planning this out in advance It’s it’s just the time is so limited all right it is not even a thing you know I just realized that butter to register the model but that doesn’t explain what the item is not showing up at all okay so let’s go and create a names constant name you Let’s go and replace that here again I shouldn’t really have any a negative effects at all let me go ahead and create a quick helper method for registering the model at least okay so we will need two parameters the item and a name for it create a model resource location you you The resource prefix the name sub tied for bearing type inventory whatever it is model loader dot register atom variant the item And be model good asset the measure as well make sure dot register item zero model so basically the same thing that we’re doing up here so let’s register model for our pickaxe you you just like that and we can do something very similar up here for registering the items which I Guess I could do that really quickly there we go a nice generic method for registering items so we can replace this with register new items item tutorial pickaxe and pass the name stuff pickaxe there we go that’s a lot cleaner okay so I don’t think that’ll actually Fix the pickaxe not appearing I don’t know why that’s happening well I imagine a large part of it is not actually putting it in a creative tab so why don’t we add that to our register new register method here so let’s also do item dot set creative tab tutorial dot Tutorial there we go now any items we registered through this method in the future will be automatically added to our creative tab and I won’t wonder where they went I know I’m so bad about remembering the creative tabs because a all of my mods have it autumn eyes and B I typically just use jei I guess that’s one bad thing about how I always use my own library mod I forget all these little things about how how stuff is registered and how it works because all just automated there we go there’s our pickaxe it doesn’t have a name but That’s okay and it should be able to mine pretty much anything so we should be able to mine obsidian with this yep and since it extensive vanilla item pickaxe class we could also run it through an enchanting table let’s just plop one down really quickly And it got 14:1 on it because I don’t have any bookshelves around the table but no that was just for a demonstration like that we made a very very basic pickaxe and you could do the same thing for say shovels axes by just extending the respective class beating the tool Material into the constructor and you’ve got a very basic tool so I’m curious why is this constructor protected all the items class is no trouble calling it but either way if you’re curious you can go through the pickaxe class and look at how it does its work this gigantic Method here is I don’t think that’s something that’s really used outside of vanilla strength first blocks that is basically the a getter for the digging speed we’ll also see that the item tool constructor calls has a list of materials that is effective on or actually to send it blocks in this case That’s effective on which again that’s not something you really see outside of vanilla If we do look at the item tool class you’ll notice it’s setting this tool class variable here which is a string that’s actually okay it’s actually in the forge section of the item tool this section here is stuff that was added by Forge so here we have to get harvest Level method and this is why I was saying do not use the tool materials outside of creating your tool this harvest level getter is what you want to call if you need to get the harvest level on a tool because the tool material may not be accurate for all Tools the tool classes thing is kind of another thing Forge does if you can set blocks to be harvested by certain tools as I don’t know if we’ve actually seen it in our tutorial block yes we have actually so you saw we passed a pickaxe string in and that’s The tool class that it can be harvested by so any item tool that has tool class pickaxe will be able to harvest this block assuming it’s a harvest level of 1 or higher so again use the getter methods and the tools do not use the tool materials to Get these properties yes the tool materials have a harvest level attached to them but that is not always accurate so looking beyond pickaxes shovels and axes you can create hoes and again it takes a tool material this constructor is actually public so I guess you wouldn’t even need to extend it let’s Take a look at swords as well again they take a tool material and this one is also public so you may be able to get away with out extending items sword if you don’t need to do anything too special with it so I’m not even going to show creating The other tool classes here I like to fill in a couple more outside the video I guess one other thing that we could fix is the unlock alized name here become you actually use the set on localized name I’m trying to remember if you need to do the resource prefix or what lad Okay so yeah that did actually do what I wanted it to do item that tutorial : pickaxe name and then you just fill that into your localization file and give it the proper name so there we go I’m happy with what we did our tutorial pickaxe class basically does nothing except Provide a wrapper to call that protected constructor everything else is just done in the mod items class pretty much and that’s how you make basic tools pretty simple really so I think that’s about all I should do for this video here I’m glad I finally had a chance to get Something else recorded I think it went well considering I I didn’t plan ahead at all I do apologize for the angry rant which uh what can you do that the tool material say is one thing that just drives me crazy all the time there are a Handful of big mods that do stuff like that so again thanks for watching for anyone who’s having model errors I do hope you can resolve the issues again just triple quadruple quintuple check everything it’s I know I hate the Jason system I may have actually provided a Card linking to one of my older videos where I was first working on 1.8 I think it took me three or four days to get most of my blocks and items rendering in silence gems it was a nightmare I hate the Jason system to this day but we’re Stuck with it what can you do so thanks for watching again and I’ll see you next time Video Information
This video, titled ‘Minecraft Modding Tutorial (Forge 1.11.x) – pt. 7 – Simple Tools’, was uploaded by SilentChaos512 on 2017-04-26 14:00:00. It has garnered 739 views and 11 likes. The duration of the video is 00:25:54 or 1554 seconds.
Creating tools (pickaxes, shovels, etc.) In this video we only create a pickaxe, but creating other tool classes is the same. Don’t forget to create a ToolMaterial (even if you don’t actually USE it). And never, ever, EVER reference your ToolMaterial outside of creating tools. I will slap you through your monitor if you do!
Useful Links: GitHub Repo: https://github.com/SilentChaos512/Tutorial-1.11 (commented code from this project) Minecraft Forge documentation: https://mcforge.readthedocs.io/en/latest/ MMD Discord server: https://discord.gg/wfKGSsB (http://mcmoddev.com/) (check out #development)