Skip to content

Dev Environment Setup

John Doe edited this page May 27, 2022 · 2 revisions

Setting up your own Forge Mod (or contributing to this one)

Required Software

Getting Started (Steps for Windows)

Part 1 - Software Installations

  1. Install Minecraft - if you haven't already
  2. Install Java Development Kit 8
  3. Install Eclipse for Java - wait with starting it

Part 2 - Operating System Configuration

  1. Set an environment variable under Win + Break > Advances System Settings > Environment Variables
    • Add a JAVA_HOME variable in the top part of the window with the value of your jdk 8 folder path
    • Add the jdk 8 \ bin folder path to the Path variable in the bottom part of the window
      • The jdk 8 folder path should look something like this: C:\Program Files\Java\jdk1.8.0_311

Part 3 - Fork and clone this github project

  1. Log into github
  2. Fork this repository
  3. Clone the forked project to your local machine
    • git command, Eclipse or some GUI (I for example used SourceTree)

Part 4 - Forge MDK: How to setup the eclipse workspace

  1. Download and Extract the Forge 1.8.9 MDK
  2. Copy the eclipse folder to the folder you cloned this project into
    • Sidenote: If you want to start a fresh project you can replace step 6 by starting your own repository, clone that one in step 7 and copy not everything instead of just the eclipse folder in this step 9.
  3. Open the command line (cmd)
  4. Navigate to that folder you cloned this project into using cd <your folder path>
    • Tip: you can change drives using e.g. C:, D:, E:, etc.
  5. Setup the Eclipse development environment by typing gradlew setupDecompWorkspace eclipse
  6. Start Eclipse
  7. Select <your folder path>\Modding Workspace\eclipse as eclipse workspace
  8. Switch to Dark Mode if you like: Window > Preferences > General > Appearance > Theme: Dark

Part 5 - Set build environment to java 1.8

  1. add sourceCompatibility = 1.8 and targetCompatibility = 1.8 to the build.gradle file

Part 6 - Build the mod to a .jar file

  1. Rightclick your Forge project in eclipse and go to Show in > Terminal
  2. Build the projects jar file with gradlew build
    • the jar file can be found under build \ libs

Part 7 - Git branch

  1. Create a new branch and switch to it
    • git command, Eclipse or some GUI (e.g. SourceTree)

Part 8 - The coding

  1. Now you are all set. Whats next? You can read a little bit about the structure of this Forge mod in the next wiki section, start changing things, test your changes by building the mod and putting the jar in the mod folder (sadly the multiplayer testing environment is broken due to the new Mirosoft login changes), commit and push to your new branch.
    • Testing: As the testing environment is broken due to the new Mirosoft login changes, a System.out.println() here and there - which is normally not the way to do things - has become the next best thing you have to a debugger. To see those outputs during runtime once the mod has been build and installed, you have to switch on the output log in the minecraft launcher settings before you start Minecraft Forge 1.8.9.

Part 9 - Commit changes to your fork to this project

  1. Once you are you are happy with your result, you can commit and push everything to a new branch of your forked project

Part 10 - [Optional] Contribute changes to this project

  1. If your changes should go towards this example project and you want to create a pull request you can do that on the github page of your forked project
    • github automatically offers you that option once you've made changes to your forked project

Sources

Clone this wiki locally