Search code examples
development-environmentminecraftminecraft-forge

How do I setup a Minecraft Forge development environment?


I want to start creating awesome Minecraft mods, and it seems that the current way to do so is with Minecraft Forge. I already got Gradle and the JDK installed, but no matter what I do I can't seem to get anything to build.

How can I get a Forge development environment working?


Solution

  • After downloading the Forge Mod Development Kit (MDK) archive, it should contain the following files:

    forge-somewhere/
    ├── build.gradle
    ├── CREDITS-fml.txt
    ├── eclipse
    ├── forge-1.10.2-12.18.1.2073-changelog.txt
    ├── gradle
    │   └── wrapper
    │       ├── gradle-wrapper.jar
    │       └── gradle-wrapper.properties
    ├── gradlew
    ├── gradlew.bat
    ├── LICENSE-new.txt
    ├── MinecraftForge-Credits.txt
    ├── Paulscode IBXM Library License.txt
    ├── Paulscode SoundSystem CodecIBXM License.txt
    ├── README.txt
    └── src
        └── main
            ├── java
            │   └── com
            │       └── example
            │           └── examplemod
            │               └── ExampleMod.java
            └── resources
                └── mcmod.info
    

    In the README.txt there are instructions on how to set it up, but to put it simple, open a console/terminal in forge-somewhere and run gradle setupDecompWorkspace. It should set up a development environment and then you should be able to run gradle build normally. Note that you have to re-run setupDecompWorkspace for every mod you want to develop/compile.

    If you're not using an IDE, or the command fails because of heap memory, you can use gradle setupDevWorkspace instead. This doesn't decompile Minecraft, so you won't be able to check the sources (which you can't without an IDE or something anyway), but it doesn't use nearly as much RAM, which is useful if you're on a lower-end system.