(This article is one of a series of commentary articles)
First article: Introduction
If the mod you've made with great care is getting better, let's output it to a jar file (Java Archive) so that others can play it!
D:\projects\mc_example_mod
├ src
├ build.gradle
├ gradlew
├ gradlew.bat
└ gradle
└ wrapper
└ gradle-wrapper.jar
└ gradle-wrapper.properties
If you set up in the same way in Introduction, the project file should look like this. Edit build.gradle
.
build.gradle
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.0'
group = 'jp.koteko.example_mod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'example_mod'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
//...
Rewrite the version
group
ʻarchivesBaseName` item on lines 16-18 to match your mod. I feel that there are many descriptions that do not require other parts, but it does not matter, so you can leave it as it is.
After rewriting, start PowerSell in the project folder (D: \ projects \ mc_example_mod
in this example) (Shift + right click in Explorer, or move normally with cd
).
Execute the command . \ Gradlew.bat build
and wait for about 10 seconds. If the message BUILD SUCCESS FUL
appears, it is successful.
A file of [archivesBaseName] _ [version] .jar
should have been generated in the \ build \ libs
folder. This is the file that will be distributed as a so-called mod.
Regarding the introduction of mods, I will omit it because it is beyond the scope of technical explanations (or rather, there are a lot of explanations in the world), but after introducing Forge, place the jar file in the mods folder and play the game. Start. Open the mods screen from the title, and if your mod is recognized, you are successful. If you are uncertain, let's actually check it in the game.
** Thank you for your long trip. ** **
Minecraft 1.12 modding with forge – 10 – Export Mod – suppergerrie2.com