Hey what’s going on guy said he was here and welcome back to another minecraft modding tutorial for version 1.0 point two in this tutorial we are going to be going over how to create a config this is quite a simple thing to do so let’s go ahead and get started Firstly we’re going to go into our main class so tutorial mob and at the very top you want to go ahead and you want to put public static file Oh file and we’re gonna pull this config that’s if I could spell public right there we go this is Going to be Java dot IO dot file yeah I’m there beautiful so that’s all we want for our main class next and in fact we will do those for your hand or later next we’re going to create the config class so inside of handle is you want a new class And we’re going to call this config handler just like that this is not going to extend or implement anything and here we want to create a public static configuration and we’re going to call that convict just import this we’re importing this from minecraft forge common convict next we’re going to need To define some variables so these variables aren’t going to be they’re going to be the food IDs that we want to chain first let’s actually create the init method so we’re going to create a public static void we’re going to call that in it this is going to take in File file an import file from Java dot IO dot file in here we need to config on fig it’s equal to a new configuration of file like that there you go next we need to create a string named category just an empty string variable for now And that is it for this little method for now next we’re going to create public static void register config this is going to take in the FML pre initialization event event inside of here we’re going to put tutorial mod.com fake equal to a new file event dot it’s Mod configuration directory plus and in here is put slash so it’s beachmarks slash plus reference dot mod ID that basically means it goes to the default directory next you want to do tutorial mod got config dot make dis so make the directories then we’re going to pull the Init method and we’re going to in it a new file main oh no not me tutorial mod so your main class config don’t get path comment reference dot mod ID plus dot c FG so convict just like that the next we’re going to go into all of our classes where we have IDs it’s all going to be in ref all of these IDs here is what we’re going to Jake copy these these variables from reference and we’re going to put them into our config Handler below this so like that there we go and then we can remove them from reference so let’s just Get rid of those give that save obviously that is going to cause a lot of errors so we need to go ahead and need to fix these so there isn’t easy to fix they’re just going to be a bit annoying so instead of this being referenced or entity manageable out first Actually we need to make these not final so just remove the final identifier from all of these pose we want them to be chained now an entity in it we can do config Handler dot entity magic book we can do convict Handler dots an entity I’m and arrow config Handler dot entity Test just like that so that’s our entity in it then we have the free trial entities so silver chest of gestured na and silver furnace so once again just going to change this to config handler so just import config Handler and we’re just going to change that in here import It and we’re going to change it in here import it child shift s save everything so those are those done and I think there was one more yes in GUI handler so just change all of these to config handler instead of reference if that’s safe Just like that so now that is all the arrows fit right now what we need to go ahead and do and actually create what’s going to be in our config file so let’s go so first is the first category so category is equal to drink so it’s going A string course and this is going to be what the name of the category so first I’m going to put an GUI IDs I’ll also dimensions let’s go ahead and do that as well so in it I mention in it so here these variables here so let’s go ahead and create these So never temp is the first one public static int never 10th it’s equal to and then what have we equaled that to to don’t you go we can just comment this dimensions we can comment this or entities and this is the GUI IDs there We go just like that so now we can go ahead change these to con fig handler don’t ever temp I mean not em but you need to make sure you change the ones down here as well as the ones up here over the world temp end temp never 10 Over world temp dot end 10 just like that that’s safe now we can close that that first is the GUI IDs so then we need to config dot add a custom category comments so first is going to be the category and the comments is going to be set IDs for each DUI so That’s just where I’m going to cool it that’s what I’m going to label it also you can set this to whatever you want for that in here we need to do GUI and score Sylver chest is equal to config don’t get int and I think we want yeah Top one so first is the name and which is going to be DUI silver chest category is just category the default value is going to be this value up here so default is to the minimum value that you can set it to I’m going to set that to Be zero the maximum value I’m going to be set to be 500 and the comment is just going to be UI ID for the silver chest so now I’m gonna go ahead and do these for the other two duis and I will be back with you before that alright so That is the GU I’ve done next is the entities so what you want to do here is where the new category is equal to and it’s going to be the name of a category two t IDs then we do config dot add custom category comments category that IDs or Each enter sync and then we do the same as we did for this so the first one I will just do the first one and then you can do it from there so entity test is equal to config don’t get in this is the name so entity test Category default value is going to be 250 minimum value and just going to put 250 maximum value I’m going to put 500 comment is the empty test ID just like that I’m going to do that for the other two entities and I will be back with it So that is the entity IDs done so next we’re going to create another category and that is going to equal I mention IDs then we do config dot add custom category comments category the comment is set IDs for each dimension and I’ll do the first one again so never done for 10 is equal to config dot get int the first is the name which is dimension never template categories category default value is to minimum value is to maximum value I’m gonna put 500 and the comment is dimension ID or the never template I’m now going to go And do these for the other two dimensions and I will be back with you then alright so now that is the dimension IDs done the next thing I would like to go over is whether the where our test biome spawns in the overworld or not so you can make that a Configurable value so whether it does spawn or whether it doesn’t so to do that let’s first going to buy a minute no in fact let’s let’s do the confit handler first so we’re going to create a new category and that is going to equal miscellaneous so miss oh yes I think That’s how you spell it I don’t know I think that’s right and then we do config dot add custom category comments so once again category and I’m going to do sets misc yes things is what I’m gonna put because you could have other things in here as well and Then we can do so let’s first create the thing so Miss Gail Lane yes I think that’s how you spell it that might be totally wrong though so that is going to be a public static boolean test and school biome and by default we’ve on that equal false then we can do test Bayern is equal to config dot get boolean the name is going to be test biomes born in or test biome generating categories category default value is false and the comment is going to be whether the test biome generates in the overworld then we can go into bio minutes and we can Create an if statement so if config and love dot test by them so that’s if it’s true then we can go ahead and do an biome manager manager dot add biome add yeah add biome be type and new biome entry oh I don’t mean to put space They’re entering biome and 10 so 10 EP wait just so you know and that means if a config says that it is true then it will add the biome to biome manager which means it will be in the overworld so that’s all I’m going to do but Obviously you can do this for other things so recipes you could have smelting recipes enabled or disabled by doing the same thing we did with biomes so I’m actually going to do that for this smelting recipe and I’ll be back use you when I have done that alright so I’ve done that so equals config billion but I blah I set the default to be true so by default it does do the Obsidian that recipe at the cover is just a label test disable the Obsidian to obsidian Inglot smelting recipe ugly in smelting recipes I just did a simple little if Statement and that should work fine a few can do this with other things maybe tabs anything that is registered in let me see anything is registered in free in it you should be able to do or anything that is registered in in it registries impacts so you could have one for this This art that we have done here and you can get rid of ores you can do crafting recipes and you can totally get rid of GUI and turn away bar and do that I don’t think you can mess with unblock register and on item register because it is registered before All of this so I hope you can do sadly it would be cool to have like an a config for items and stuff but it’s yeah you can’t really do that after you can actually have a boolean for whether the NC exists or not that’s that’s something You can totally do but yeah that’s all we’re going to do for our config file but we need to make sure we register it of course so inside of pre in it registries at the bottom we are just going to put con fig handler dot register config event so you can see That’s not gonna work because we have an error so what we need to do is these need to have a new parameter FML pre initialization event event which means we can go into our main class and we just pass in the event parameter just like that and then well It’s pretty and dandy no it’s actually go and check that it exists I’m not gonna try to edit the config file because I want to but I will show you that it does exist and yeah so obviously you can see it’s not here but we should Be able to refresh it I know we need to run the game all right I think I actually just accidentally run it twice yes I did all right so guys I have just refreshed it and it has come up a folder called tutorial mob if you go in here lose Tutorial mod convict oh one thing I forgot to do is actually save the contact let’s go back into our config file because when you make the config you need to make sure you save it you need to go down to the very bottom and at the bottom you need to put config Dots save just like that that’s a simple little thing I missed it so guys the game is downloaded so hopefully we can refresh this I can open it and here it is so configuration file dimension ID set IDs for each dimension and I’ll see there’s four range it’s 2 to 500 and it Has done these for all of these yeah that’s that’s the conflict file that will be available in your mod for anyone who wants to have changed these IDs that’s it really so obviously says integer I Finster be Liam and you can also have floats so if You have any float values that you want it to be adjustable then you can you can put them in your config file anything that you want you to be configured by mod pack makers you probably want to put your config file well I did enjoy a Story oh please – be sure to smash your face into that like button and subscribe if you really enjoyed please do be sure to share it and yeah I will see you guys in the next video goodbye Video Information
This video, titled ‘Minecraft Modding Tutorial 1.12.2 – Episode 45 – Configuration File’, was uploaded by TurtyWurty on 2019-09-14 19:19:36. It has garnered 1576 views and 38 likes. The duration of the video is 00:20:33 or 1233 seconds.
Hey guys, TurtyWurty here! In this tutorial, we go over how to make a configuration file for IDs. So remember, if you guys have an issues/problems or need support, or just want to chat, join my discord server using the link below! Also below is a form that you can fill out for what videos you want to see next and in the future. If you want your suggestion to be taken into consideration, make sure you put it in the form and nowhere else. Also, if the code is not working or there is a piece of code which I have said to copy, you can find all the code from the GitHub below. Hope you guys enjoy!
My Discord Server: https://discord.gg/d5cGhKQ My Personal Mod: https://www.curseforge.com/minecraft/mc-mods/vanilla-expansions GitHub: https://github.com/darealturtywurty The form on Video Requests: https://forms.gle/9RyzCgjEvmGpGjrE8