Exporting Your Mod

Hey! Now that I’m done, I want to release the mod! But how?

Not to worry, here’s exactly how you do just that!

If you have Gradle installed independently, skip this step. If you don’t, you have two ways, either one will do.

The easy temporary way, copy “gradlew” file from your forge folder to your mod folder (inside workspace).

The more permanent way, go and download and install Gradle on your system.

Alright, we’re done with setting up gradle, now we’ll need a build.gradle file, which stores the info needed for building your mod. You won’t have it by default, so go ahead and copy it from forge folder.

In build.gradle, modify the following lines:

version = "1.0"
group= "com.yourname.modid"
archivesBaseName = "modid"

Change those to the version you specified in your main mod class, the package for your main mod class, and the modid respectively.

Now, let’s get to building. Open command prompt. May it be Windows or Mac OS or everything else, open your version of command prompt, and navigate to your mod folder, where the build.gradle file you copied to is located.

Tip: Shift-Right click on the background in Windows Explorer in the mod folder, and click “Open command window here”. That’s what you get for using windows.

Now, depending on which option you chose during gradle setup, you do the following:

gradlew build

or

gradle build

Hold on a few moments… And voila! Navigate to /build/libs/ and there you go, your JAR file! Put this in the mods folder and it’ll work like a charm! That is, if you coded your mod right in the first place.

Advertisements