Forge for Minecraft 1.14.2 has been released, so here is the first part of the tutorial!
Before I get started:
You should have an IDE installed. I will be using IntelliJ IDEA, but it is also possible to use Eclipse. I will not be teaching Java so you should do a Java tutorial first if you don’t have any experience. Most steps are the same on different operating systems, but some steps may differ.
Well, let’s get started!
- First, you should download the latest version of Forge (This tutorial will be for Minecraft 1.14).
Go to the Forge download site and download the MDK (Mod Development Kit).
- Extract the downloaded file to an empty folder. You should see a lot of files, but you don’t need all of these files to get started.
You only need:
- the gradle folder
- The .gitignore file
- Copy these files in a new folder. I will be referring to this folder as the root folder.
- Open the build.gradle with a text editor and replace the group and archiveBaseName variables with your name and modid, following the format specified.
- Now import the project in your IDE of choice, I’ll be using (and explaining it for) IntelliJ IDEA.
- Click on Import Project, or File –> new –> project from existing sources
- Browse to your root folder and select the build.gradle
- Make sure you have “Create directories for empty content roots automatically” are checked, you can also check “Use auto-import” if you want to.
- IntelliJ and gradle should initialize everything needed. (This may take a couple of minutes, for me it took about 5 minutes)
- In IntelliJ you need to run genIntellijRuns, you can do this by either running the command (there is also genEclipseRuns, and genVSCodeRuns is WIP):
or by opening the gradle menu and under “Tasks/fg_runs” double clicking genIntellijRuns. After running this you’ll get a client and server run task, the first time you run it’ll ask you to fix an error, you fix this by selecting the main module in the “Use classpath of module:” selection list. (Image is from 1.13.2, the configuration is now called runClient and runServer by default)
- Now you are ready to start modding!
You probably also want to set up a git repository so you can share your code and people can help you. If you know how to do this you can just skip to the next part.
I’ll explain how to put the repository on GitHub, there are other websites where you can put it but I am familiar with GitHub.
To create a repository and upload your code follow the following steps:
- Create an account at github.com
- Create a repository by clicking the plus button at the top right.
- Copy the URL it gives you, the URL should be in the following format: https://github.com/USERNAME/REPONAME.git
- Download git and install it
- Open a PowerShell/command prompt/terminal. If you are on Windows you can hold shift and right click in the root folder.
- git init This will initialize the git repository
- git remote add origin URL FROM STEP 3 This will tell git where to upload the code
- git add . This will add all of the files in the current repository to your git repo. Make sure you add the “.”!
- git commit -m “My first commit!” This will tell git to remember the state of all your files at this point in time
- git push origin master This will upload your code to the repository you made earlier!
- Now when you made changes you only need to run:
- git add .
- git commit -m “Message explaining changes”
- git push origin master
I hope that was easy to follow! If you have any question, don’t hesitate to ask in the comments! Also, if you saw any errors in the tutorial please let me know so I can fix it!
Next time we will start setting up the MainMod file.
Till next time!