Chapter 10. Sharing Mods

The previous chapters showed how to create a wide variety of mods. Now that you know how to make mods, it’s time to share them with your friends. This can be easily done by packaging these mods into one JAR file. This chapter will show how to share Forge mods. Then, you will learn how to install Minecraft Forge onto your regular Minecraft client so that you can install your mods there. Making the JAR file requires only one command, and installing Forge is also easy. Consequently, this chapter will be short, but useful if you want to share your mods with your friends.

Building the JAR File

Any mods created using Forge need to be properly packaged before they can be shared. This allows Forge to load the mods correctly. Proper packaging is required no matter what the mod is like.

Fortunately, Forge comes with a simple command to package your mods. Open up Command Prompt on Windows or Terminal on Mac, and go to your Forge folder. In that folder, run the command gradlew build if you are on a Windows computer or ./gradlew build if you are on a Mac computer. This command will give the output shown in Example 10-1.

Example 10-1. Gradlew build command output
**************************** Powered By MCP: http://mcp.ocean-labs.de/ Searge, ProfMobius, Fesh0r, R4wk, ZeuX, IngisKahn, bspkrs MCP Data version : unknown **************************** :compileApiJava UP-TO-DATE :processApiResources UP-TO-DATE :apiClasses UP-TO-DATE :sourceMainJava :compileJava warning: [options] ...

Get Minecraft Modding with Forge now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.