Skip to content

Setting up Forge for 1.7.10

makamys edited this page Aug 9, 2021 · 4 revisions

I found very little documentation about this on the internet, so here's a guide to building an 1.7.10 mod using ForgeGradle, working in 2020-03-05.

Example project

The easiest way is to use my forge-mod-template. The notes below are preserved to chronicle my journey towards figuring it out.

How to 1.7.10

1. Get a Forge src zip.

This link should take you to 1.7.10's page: https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.7.10.html (note: 1.7.10_pre4 is older than 1.7.10)

2. Unzip it to some folder

At this point, you'd expect to be able to cd into the folder and run ./gradlew build. But doing that will give you the following error messsage:

* What went wrong:
A problem occurred configuring root project 'forge-1.7.10-10.13.4.1614-1.7.10-src'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve org.eclipse.equinox:common:[3.2.0,4.0.0).
     Required by:
         :forge-1.7.10-10.13.4.1614-1.7.10-src:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:jobs:3.5.300-v20130429-1813
         :forge-1.7.10-10.13.4.1614-1.7.10-src:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:contenttype:3.4.200-v20130326-1255
         :forge-1.7.10-10.13.4.1614-1.7.10-src:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.equinox:preferences:3.5.100-v20130422-1538
      > Failed to list versions for org.eclipse.equinox:common.
         > Unable to load Maven meta-data from http://repo1.maven.org/maven2/org/eclipse/equinox/common/maven-metadata.xml.
            > Could not GET 'http://repo1.maven.org/maven2/org/eclipse/equinox/common/maven-metadata.xml'. Received status code 501 from server: HTTPS Required

It turns out Maven stopped supporting HTTPS in 2020-01-15, and Gradle-2.0, which is what 1.7.10's src zip uses, is hardcoded to use HTTP. The solution?

3. Upgrade gradle

Gradle-2.1 and higher support HTTPS.

To upgrade your Gradle wrapper, edit gradle/wrapper/gradle-wrapper.properties and change the distributionUrl to end with gradle-<version>-bin.zip. Set the version to at least 2.1. ForgeGradle 1.2 supports up to 4.4.1.

4. Build!

At this point ./gradlew build should work!

Troubleshooting

* What went wrong:
A problem occurred evaluating root project 'forge-1.7.10-10.13.4.1614-1.7.10-src'.
> Failed to apply plugin [id 'forge']
   > You must set the Minecraft Version!
      > java.lang.NullPointerException (no error message)

If you get this error, your Gradle version is too high. I get this error with Gradle-4.8.1. Due to API changes in Gradle 4.5, ForgeGradle 1.2 doesn't work with Gradle 4.5 and higher.

There are some forks of ForgeGradle available that support Gradle 4.5 and higher, but I don't have much experience with them. The ones I know of are:


(Source used: https://qrunch.net/@toliner/entries/XsEydENmoDjW2qY7)