Hello and welcome back to another tutorial today we’re going to be getting started with modding in forge 1.18.1 and we’re going to start completely from scratch if you want to do some modding it’s recommended that you learn java but you’ll probably be fine if you’ve done Any kind of coding before we’re going to be using eclipse ide but you can use intellij or vs code if you’d like to and in this video we’re going to be setting up a very basic mod and downloading all the software that we need if you need Any help feel free to join my discord which is in the description let’s get started so we’ll start by downloading the ide or the integrated development environment to do that let’s go to eclipse.org and click download i’m just going to download the latest version of eclipse then click download again and Just save the installer then let’s go to adoptium.net and download java 17. if java 17 isn’t here if a java 18 gets released in the future you can go to release archive and download java 17 for windows but i’m just going to download it from here let’s once again save it And then we can start installing stuff so once that’s downloaded let’s open the jdk click next and we want to make sure to tick select java home variable then click next and click install and then waits for the installer to finish click finish and now we can install eclipse so Let’s open the eclipse installer and then we want to click eclipse id for java developers and it should auto select the java 17 hotspot that we’ve already downloaded it make sure it’s not one of these it’s the one that’s in c program files eclipse adoptium jdk 17 because that’s the jdk that we want to use for eclipse you can select an installation folder and take any of these and then click install let’s accept the software agreement and wait for the installer to finish while it’s installing we can go to files.minecraftforge.net and i’m going to select 1.18.1 because That’s the version i’m going to be using if at some point there’s a 1.18.2 this should be pretty much exactly the same for those versions and i’m going to use the mdk currently there’s no recommended but if we go to something like 1.17 um there’s a recommended here that you can Download as well so you can pick whichever one suits you i’m going to pick the latest for 1.18.1 and i’m going to click on the mdk which stands for the mod development kit skip past the add focus page and then download the zip file to your computer so now that Eclipse has finished installing and this is finished we can close eclipse and this will launch eclipse id we can actually close this for now we don’t need it and then we can copy a zip file to our modding folder so i’ve created a new folder in my computer which is just Going to be called tutorial mod 1.18 but you can name this whatever you want in here i’m going to create two folders our tutorial mod which is the name of my mod and tutorial mod workspace and in our tutorial mod we’re going to paste that zip file and we’re going to right click And extract it here we can use the windows extract thing so that all of the stuff that’s been inside the 1.18 folder is going to be in here if you want you can now delete the license and readme credits and change log from here and There we go now we can open eclipse and set the workspace we’re going to click browse and we’re going to select the tutorial mod workspace folder and click select folder then we’re going to click launch and here we go we’ve launched our first window of eclipse ide so i’m going To go to window preferences under general appearance i’m going to change the theme to dark and under appearance colors and fonts java i’m going to click on java editor text font click edit and select the font i use for my videos then i’m going to click apply and close And we’re going to need to restart later but we’ll do that in a bit we can close the outline problems javadoc and declaration windows in the package explorer window on the right we’re going to click on the three dots and change package presentation to hierarchical then we’re going to go to help eclipse Marketplace and this is where we can install extensions i’m going to install a couple that i like to use so i’m going to install the json extension so let’s just search for jason and i’m going to use this one and press install accept the agreement and click finish And install anyway and that’s all i need for now so i’m just going to click restart and there we go now i can import my project so i’m going to click on import projects on the left and we’re going to go to gradle existing gradle project and click next click next again In the project root directory we’re going to click browse and then navigate back to our modding folder in tutorial mod so you should see this we’re just going to click select folder and then click finish and this might take a while depending on your device so just wait For this to finish and there we go now that it’s reloaded we can open this up here and go to source main java and in here we can see the code for our mod and before we actually edit any of the code we’re going to quickly edit the Build.gradle and this is going to give us important information about the mod like what it’s called how to build it etc so we’re going to start from the top and work down i’m first going to remove the comments over here and then i’m going to replace com.yourname.mod id with com.cifl And then the mod id and the mod id is an id which is unique to your mod so you can’t have conflicting ids mine’s going to be tutorial mod and this can only contain lowercase characters numbers and underscores so i’m just going to use tutorial mod we’re going to use java 17 Here i’m going to close this and we’re going to use official mappings for now we’re going to leave the line with the access transformer because we might need that later we can remove all of the comments over here and all of the comments over here and the same for the Data we’ll delete this comment we’ll leave the repositories empty for the dependencies we’ll just leave the minecraft dependency and then let’s remove the comments here finally in the runs section we want to change this example mod to our mod id so in my case tutorial mod and i’m just going to copy that Everywhere down here title i’m going to put tutorial mod vendor that’s your name so 64 and my name here as well and i’m just going to delete this and there we go that’s our build.gradle so now to apply the changes we’re going to go down here To gradle tasks and expand this and we first want to do a forge gradle run and this is where it differs depending on what you’re using i’m using eclipse so we’re going to use gen eclipse runs so double click that and then wait for this to finish this may take a while since It’s the first time running this command and once that finishes we’re going to go to gradle tasks and under ide select eclipse and once again this can take a while but it went pretty quickly for me now we’re going to click on our tutorial mod and press f5 to refresh and we Should see a bunch of new files so now we want to delete this package over here by clicking delete and in our build.gradle we set the group to com.cy4.tutorialmod so we pretty much have to do the same thing let’s right click on source main java and create a new package And we’re going to call this com.cy4.tutorialmod in this package we’re going to create a new class and this is going to be the main class for our mod so in this case it will just be tutorial mod and we’re going to annotate this class with at mod To make sure that this class is recognized as a mod class then we want to open brackets and inside this annotation we want to pass in our mod id so now forge knows that this mod is going to be called tutorial mod so that’s its id and it’s going to load This class when it needs to load the mod in here let’s create a constructor for our tutorial mod and inside here we actually want to register it so let’s press ctrl space and type minecraft forge press dot go down to event bus press dot again register and then we’re Going to write this and that’s actually all the code we need to set up our mod then in the source main resources we’re going to go to meta inf and open mods.com and you want to be very careful here we only want to delete the comments so the comments will start with a Hashtag so let’s just delete all of this version 39 means we’re using 1.18 so we want to leave that here in the license i’m going to put mit which means that any of you can use this code the mod id this is of course tutorial mod we’re Going to leave the version to use the one in the build.gradle for the display name this is the full name of our mod so it’s going to be tutorial mod this is the update and display url which i’m just going to remove but you can keep these If you’d like to the logo file i’m going to keep but leave it empty credits let’s do a tutorial mod by cy4 for the authors i’m just going to put cy4 and the description is a multi-line description and this is mandatory i’m just going to remove all the text inside It and then type my own description next we have our dependencies and we want to replace example mod with tutorial mod so let’s just keep this and delete all the comments inside it and once again we want to replace the example mod in here and this as our dependency for minecraft So this is between 1.18.1 and 1.19 so any of these versions will work and there we go that’s our mods.tommel now we can actually run the game next to the run arrow there’s a drop down button click run configurations then under java applications click the drop down click on run client And then click run and this is actually added our run client configuration next time we can just click the drop down and run client or just press the big button and this is going to start loading minecraft and there we go after a while minecraft has opened and you can See the star next to it meaning it’s modded let’s click on mods and here’s our tutorial mod and there we go we’ve created a simple mod and loaded it into the game in the next episode i’ll be covering how to make blocks items and creative tabs That’s going to do it for this video if you need any help join the discord the link is in the description you can also leave a comment or go into the description to find any links used in this video also in the description is the github which has a repository with All the code for each episode so if you want to just copy paste you can do that thank you for watching and i’ll see you next time You Video Information
This video, titled ‘Minecraft Modding Tutorial 1.18 | #1 – Mod Setup’, was uploaded by Cy4’s Modding on 2021-12-21 14:03:58. It has garnered 153978 views and 3780 likes. The duration of the video is 00:10:53 or 653 seconds.
IM BACKKKK (and hopefully to stay :D)
(ɔ◔‿◔)ɔ ♥ ~ expand me
C://Help/ Discord: https://discord.gg/x9Mj63m4QG Or comment on this video!
C://Links/ Eclipse: https://www.eclipse.org/ Java: https://adoptium.net/ Forge: https://files.minecraftforge.net/
C://Source_Code/ https://github.com/Cy4Shot/Modding-Tutorial-1.18
C://Follow_Me/ Subscribe: https://www.youtube.com/channel/UCJIDXtGpf4wv1ybDzdTA_vQ/ Website: https://cy4shot.github.io/
C://Time_Stamps/ 00:00 – Intro 😀 00:32 – Java + Eclipse 01:49 – Downloading Forge 02:27 – Folder Structure 03:15 – Eclipse Setup 05:00 – build.gradle 07:05 – Main Class 08:12 – mods.toml 09:36 – Testing 10:18 – Outro 😀