Hello guys and welcome to the second part of the Minecraft 1.13 monde tutorial series in Ted’s episode when you’re setting up the basics so that we can boot our mods into the game for the first time if you haven’t watched the Java tutorial series that are linked to The description please go watch that unless you obviously know Java already in which case you’ll be fine well please just watch that tutorial so you fully understand everything we’re going to be doing in today’s episode and there on in tutorial series anything that we need additional to that I will teach you in This tutorial series but please make sure you’ve watched that before beginning if you’ve done that then let’s get started firstly we’re going to go over here to Java and create a new package call it your username so mine is now Harry dot and the name of your mod so tutorial mod And that’s a package you should know that is if you’ve gone watch the Java tutorial series create a new class and this going to be our main mod class so you can either call this name of your mod or the main class or the mod class I’m going to call the name of my mod tutorial mod and we create that class there we are then going to add an annotation which is apt mod which tells in forge that this is a mod ctrl shift o and that will automatically import the app mod package here and it wants to Take in a parameter which is your mod ID and what ID is a string of characters a little 64 office long that represents the unique ID for your mod so make sure this is unique to your mod and no one else’s mod or if you try to run them in Tandem it won’t work so I’m going to put a tutorial mod as I said you do not want yours to be tutorial modules to be something different it has to be lowercase all things have to be lower case when we’re coding apart from class names so now I’ve Created that we have declared this is the mod class we are going to create the constructor control space and I’ll open up this window here and we can add the constructor in and inside of here we need to UM have it so that the Forge functions all the stuff that Forge does Runs on our mod as well as the other mods so minecraft forge dot event bus dot register this so now that all the Mirage functions will run on your mod the next thing we’re going to do is create two functions one is the setup function so private void setup and the Parameters of this is going to be a final FML common set of event and named that events so this will everything inside of here will run under the set of event this is what used to be the pre init function if you’ve modded before so Anything you would have put in pre in it put it in here and anything new I’ll show one to put things in there when we get around to it and then you can copy this function and paste it and we’re going to call it client registries and Instead of FML common set of event we’ll change this to FML clients that event and everything’s head of hair will only run on the client side and so that’s things like models and other things that we don’t want to be rendering for everyone so now we’ve got those two Functions we need to register them inside of our constructor so that they’re bit loaded when we’re loading the mod so FML Java mod loading context dot get dot gets motive nth bus dot add listener this colon colon setup what this does is when we load in the mod it will lust Listen for everything inside of the setup function and we can do the same thing for the client registries again you can click control space and it will search for the client registry registries function which is here so now those two are both the loaded when we Load the mod next thing we’re going to do we’re firstly going to create an instance so public static tutorial mod instance and we’re going to declare that inside of the constructor here instance is equal to this and this is a way of referencing our main mod class outside Of our main model class we also need to create a variable for our mod ID public static final string mod ID and it’s equal to make sure it’s the same string as what you had up here in the at mod we’d have to use this string here as That we have type Malins have this out and as it’s above our class and we can’t declare a variable before our class but whenever we reference our mother z from now on anywhere in a mod make sure we reference to this variable here because then if we ever change our melody Everything inside of your mod will be updated to match the new mul ID rather than you having to manually change every single one and the final thing we’re going to create is something called a logger so private static final logger call it lager and that’s equal to log Manager doctor gets lager and then put mod IV has it’s an intake control shift oh and make sure you choose log4j lager and this lager is something that we can use to print things out in the console which you can find over here and it will Display or any messages that we want to confirm that things are working correctly so for example inside of the setup function we can put lager dot info and choose the one that his string message and we can write anything here so use right setup method registered and It will one week get around to looking at this setup it will print out in the console setup method registered and you know the same thing as had the client registration function and change that to client registries and that is the main mod class we’ve set everything up for it Might need now we can go into resources meta in and this mod dot Tamil file it’ll open up in your text heads here or just in the actual thing itself and this is a file that tells a lot of information about your mod to the forest mod loader there’s a lot of comments Here which we can remove to make it more simple and we’ll go through each step the mod loader it’s obviously Java forge mod loader and it will always be that so you can I would leave that bad the loader version is 24 that’s the current and forged version and will be for all Of Minecraft 1.13 so you can leave up as it is the issue tracking URL this is the place if you have a website where people can report issues about your mod I’m gonna remove that for now but you can add this back whenever you want just by referring to this variable here And the display URL this is the place where your mod where you can find your mod so you can put your cursed Falls link here or a link to your website or anything like that once again be removed that one the logo file I will go over Towards the end of this tutorial series and it’s just a file a logo that displays next to your mod in the list of mods and I’m gonna remove that for now as well the credits so anything that you want to show up inside of your mods file They you to credit people so credits you just thank me if you want I can playing anyone you want in the credits and it will show up in to have the forge mod page the author’s so the people that made the mod that’s going to be yourself So this is the mod section so it’ll be the list of mods well you’re gonna have one mods obviously so the mod ID make sure it’s the same as the one you have in your main mod file so copy that and put it inside of here the version number And we’re just going to change here to 0.1 and as it’s the first version of our mod the mod name say whatever you want your mother to display out so Harry its tutorial mods can be my name the update URL and where it can look to see if There’s any updates if you have one of these again you can set it up and but I’m going to move it for now the description this will be multiple lines long and if you me whatever you want any information about your mods and dependencies and mods mods that your mod Relies on so that your mod will not work with without so changes the sample Matsuyama heidi and you can leave all this stuff as it is as your mod does rely on forge and minecraft and that’s the mods optimal file complete if you are watching When Forge is out of beta then you can just should be able to run this and and it should just work unfortunately the current version of Forge and it doesn’t work when I’m clicking this Run button from eclipse so we are going to have to do something it’s a quick workaround go Into your file explorer and find where you have tutorial mods make sure in view you have a file name extensions enabled and change the name of this to run the client dot box then edit its file I’ll open up the text editor and you have to want right to Gradle W run client and then save it then double click this and it will begin to run the game and there we go we have Harry’s tutorial mod version 9.1 mod ID tutorial mod this is my mod its graves up to PewDiePie so if you have found this useful or enjoyed this Tutorial please leave like so if you so if you have enjoyed this tutorial please leave a like down below and subscribe for more thanks for watching my name’s been Harry and goodbye Video Information
This video, titled ‘Minecraft Modding Tutorial for MC 1.14/1.14.3 – Basic Mod Classes’, was uploaded by Harry Talks on 2019-02-24 15:00:03. It has garnered 37171 views and 746 likes. The duration of the video is 00:12:16 or 736 seconds.
In today’s episode, we setup our basic mod classes.
Welcome to a brand new Minecraft Modding tutorial series for 1.13. Below, you can find links to a basic Java tutorial series that you need to watch before beginning the series and my GitHub where you can access the code used in the tutorials. Also, you can join my Discord where we discuss problems and help each other with modding.
Basic Java Tutorials: http://tiny.cc/JavaTuts GitHub: http://tiny.cc/HarryGitHub Discord: https://discordapp.com/invite/xwg8zQJ