In this tutorial I will show you how to release your own mod. The first thing you need to do to release your mod is open up the build.gradle file in your forge directory. It should look like this.
name = "forge"
url = "http://files.minecraftforge.net/maven"
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
apply plugin: 'forge'
version = "1.7.2-1.0"
archivesBaseName = "tutorial"
version = "1.7.2-10.12.0.997"
// replace stuff in mcmod.info, nothing else
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
// copy everything else, thats not the mcmod.info
When releasing your mod there are only 3 lines you should change. Those are the lines starting with version, group and archivesBaseName.
When you compile your mod by running a command you will get a file which will have the name archivesBaseName-version. Because of this it’s very important that you write the right name and version. The archivesBaseName should simply be the name of your mod. For the version you should be using the Minecraft version followed by a – and then the version of your mod. When you are releasing version 1.0 of you mod for Minecraft 1.7.2 the version number should be 1.7.2-1.0. This way users can easily see which version of the mod they have and for which version of Minecraft it works. The group line is the package your code is in.
To release your own mod open up a command prompt in the forge folder with the gradle.bat file. Next you will have to run the following command.
This command will compile all of your code and make it instantly ready to use. Once it’s done enter the build folder and then the libs folder. In there should be a .jar file called modid-1.0 in which you should be able to find all of the resources and code in your development environment. When you paste this file in the mods folder of a Minecraft with Forge installed you will be able to use your mods.
However, all of the code for every mod in the workspace will be in there. If you have a single mod this isn’t a problem, but if you have multiple this can be quite annoying because you will have to go into that file and find out which files are from which mod etc. If you have multiple mods you may want to do the advanced setup. It’s a little bit more work, but it’s better.
For a more detailed explanation and much more, check out my book Sams Teach Yourself Mod Development for Minecraft in 24 Hours.