Getting Started
Creating a new content pack
To get started, you'll need to download and install Java JDK 8 and IntelliJ (or a Java compatible IDE of your choice, but we'll focus on IntelliJ here - the community edition is free). You will also need a copy of Minecraft Forge's MDK for Minecraft 1.12. I highly encourage using Minecraft Forge 1.12 instead of 1.12.2.
Once you have the MDK downloaded, extract the contents into a directory of your choice. The name of the directory will be your project name. For the context of this tutorial, we'll use "Example Pack" as our project name. Open the directory in IntelliJ, and allow for the project to be imported. You may need to update Gradle to a supported version in the gradle/wrapper directory inside the project, such as https\://services.gradle.org/distributions/gradle-4.9-bin.zip. Your gradle-wrapper.properties file should look as follows.
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
Ensure the project loads without any errors. Warnings are expected, as Forge 1.12 is a bit old. On the right side, open the Gradle side menu. Look for the "forgegradle" dropdown, and select setupDecompWorkspace. This will download all the files for Minecraft to run in our development environment. Once that task completes, run genIntellijRuns. This will create two run tasks (visible in the top right of IntelliJ's interface, next to the green run triangle). If you see a miniature "X" next to the task, click the task dropdown, select edit, and ensure that JDK 8 and the main module are selected.
Run Minecraft and ensure the game loads. You should be able to see the game run without any problems, and an example mod contained inside.
Now, open the build.gradle file inside the project directory. We'll need to make a few edits here. After the buildscript section, we'll insert the following:
repositories {
maven {
name = "Rainyville Maven"
url = "https://maven.rainyville.org"
}
}
Then in the dependencies block, we'll add deobfCompile 'org.rainyville.modulus:expansive-weaponry:1.12-1.1.9'. You may need to run setupDecompWorkspace after these changes to ensure that Expansive Weaponry is downloaded. Your build.gradle should look something like this:
buildscript {
repositories {
jcenter()
maven { url = "https://maven.minecraftforge.net/" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
repositories {
maven {
name = "Rainyville Maven"
url = "https://maven.rainyville.org"
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge/EXW to be setup.
version = "1.0"
group = "com.yourname.modid"
archivesBaseName = "modid"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = "1.12.2-14.23.5.2847"
runDir = "run"
mappings = "snapshot_20171003"
}
dependencies {
deobfCompile 'org.rainyville.modulus:expansive-weaponry:1.12-1.1.9'
}