Basic Modding - Updating Forge / Gradle

Goal

I want to show you how to update Minecraft Forge for your Modding workspace.

Difficulty

2/10 - Quite simple

Prerequisites

  • Of course, you need to have a Forge workspace.

Forge Version

Its an updating process, so why should there be a special Forge version?


Updating Forge

Updating Minecraft Forge is as simple as installing it, just because its the same process. The only thing we have to do additionally is to adjust the Version in the build.gradle file in the Forge workspace.


What you need first is the version number of your preferred Forge version. You can find it on files.minecraftforge.net. On this page you can look for your preferred version and you'll find the version number right next to it.

I want to install the latest recommended Forge build for 1.7.10, so I'll use the version 10.13.2.1230.


Now we open the build.gradle file in the folder where you installed Forge.

Here, we search for these lines:

build.gradle:
minecraft {
    version = "1.7.10-10.13.0.1180"
    runDir = "eclipse/assets"
}

The version tag describes the Forge version used. We need to replace it with our new version number.

build.gradle:
minecraft {
    version = "1.7.10-10.13.2.1230"
    runDir = "eclipse/assets"
}

Now we need to run gradlew again, lile we did when we installed Forge.

This time we need three instead of two commands.

console:
gradlew cleanCache

gradlew setupDecompWorkspace --refresh-dependencies

gradlew eclipse //or idea

When you have run these commands successfully, Forge is updated completely. Now you can go to your mods' folders and change the version number in their buildscripts. When you open the mods in eclipse, you might need to refresh the Forge Project. Therefore, right-click it and select "Refresh".

Updating Gradle

Updating gradle is only necessary when Forge changes to a different gradle snapshot. When this happens and your settings are incorrect, you'll see a message when you try to update forge. This message may look like this:

console:
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Julian\Desktop\Modding\Forge\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating root project 'Forge'.
> ForgeGradle 1.1 will only work for Minecraft 1.7.2

If this message shows up, you need to change the gradle version in all of the build.gradle files to a version which works for the preferred Forge version. To find out which version is needed, you either try out several versions or you download the Forge pack for this version and read the build.gradle file there. To update gradle, search for the following pattern and replace the version there:

build.gradle:
buildscript {
    [...]
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
    }
}

Once you have done this, rerun gradlew and it should work fine.


Recommended tutorials to continue with

Take a look at the tutorial overview and find out what you want to do next!


Comments and Questions:

If you want to report modding problems, please make sure to include the code in a pastebin link or something else! Don't just write "It doesn't work", otherwise your post will be deleted. For more complicated problems, please use the troubleshooter form.