Skip to content

Instantly share code, notes, and snippets.

@tterrag1098
Last active December 11, 2015 07:33
Show Gist options
  • Save tterrag1098/08547573cef3fd94ffd7 to your computer and use it in GitHub Desktop.
Save tterrag1098/08547573cef3fd94ffd7 to your computer and use it in GitHub Desktop.

From Zero to modding

  1. Obtain a source distribution from forge's files site. (Look for the Mdk file type, or Src in older 1.8/1.7 versions).
  2. Extract the downloaded source distribution to an empty directory. You should see a bunch of files, and an example mod is placed in src/main/java for you to look at. Only a few of these files are strictly necessary for mod development:
    • build.gradle
    • gradlew (both .bat and .sh)
    • The gradle folder
    • You may reuse these files for all your projects.
  3. Move the files listed above to a new folder, this will be your mod project folder.
  4. Open up a command prompt in the folder you created in step (3), then run gradlew setupDecompWorkspace. This will download a bunch of artifacts from the internet needed to decompile and build Minecraft and forge. This might take some time, as it will download stuff and then decompile Minecraft. Note that, in general, these things will only need to be downloaded and decompiled once, unless you delete the gradle artifact cache.
  5. Choose your IDE: Forge explicitly supports developing with Eclipse or IntelliJ environments, but any environment, from Netbeans to vi/emacs, can be made to work.
    • For Eclipse, you should run gradlew eclipse - this will download some more artifacts for building eclipse projects and then place the eclipse project artifacts in your current directory.
    • For IntelliJ, simply import the build.gradle file.
  6. Load your project into your IDE.
    • For Eclipse, point your workspace to the eclipse folder that was created when you ran gradle eclipse.
    • For IntelliJ, you only need to create run configs. You can run gradlew genIntellijRuns to do this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment