Getting Started

From EXW Docs
Revision as of 00:32, 7 June 2026 by Unknown025 (talk | contribs) (Adding a gun)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Setting up your development environment

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. You do not need knowledge of programming or Java to complete this tutorial, but it is helpful.

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'
}

Creating a pack

Now that we have both Forge and Expansive Weaponry loaded in a development environment, we can create our content pack. You'll notice that when you run Minecraft from within IntelliJ, all the game files are located in the run subdirectory in our project. Inside, there is an Expansive Weaponry directory. We'll create our content pack by creating a new subdirectory inside, named "Example Pack". It should be located inside Example Pack/run/Expansive Weaponry/Example Pack (replace with your own pack name as applicable).

Now, create a new file named exwpack.info. This will contain some basic properties for our content pack. All the fields are documented at EXWPack.info, but as a minimum we'll need our pack ID, version, and target API.

{
  "packId": "epack",
  "authorList": [],
  "url": "https://docs.exw.rainyville.org/Getting_Started",
  "version": "1.0.0",
  "logo": "logo.png",
  "name": "Example Pack",
  "description": "This is a description that'll be displayed in the main menu.",
  "credits": "Thanks to the wonderful tutorial author.",
  "targetAPI": "2.0.0",
  "creativeTabIcon": "diamond_sword"
}

At this point, if we load the game, you'll see the example pack shows up in the content pack list.

Adding a gun

Finally we get to the fun part: adding items. We'll add an AKM into the game. First step, in our content pack directory (inside the Expansive Weaponry directory) we'll create a directory named guns. Inside the new directory, we'll create a file named epack.akm.json. It is strongly encouraged to name your JSON files as <pack ID>.<item name>.json. Inside our newly created JSON file, we can now fill out some parameters for our gun (which can be found at GunType). Here's an example:

{
  "modelName": "epack.ModelAKM",
  "maxStackSize": 1,
  "internalName": "epack.akm",
  "displayName": "AKM",
  "iconName": "epack.akm",
  "gunDamage": 8,
  "roundsPerMin": 500,
  "recoilPitch": 8,
  "recoilYaw": 5,
  "randomRecoilPitch": 0.5,
  "randomRecoilYaw": 0.5,
  "crouchRecoilModifier": 0.8,
  "bulletSpread": 2.0,
  "fireModes": [
    "full",
    "semi"
  ],
  "reloadTime": 60,
  "acceptedAmmo": [
    "epack.30rnd76239"
  ],
  "allowDefaultSounds": true,
  "emptyPitch": 0.05,
  "weaponSoundMap": {
    "weaponFire": [
      {
        "soundEvent": "weaponFire",
        "soundName": "epack.ak103.fire",
        "soundNameDistant": "epack.ak103.firedist",
        "soundRange": 64,
        "soundMaxRange": 96,
        "soundFadeMultiplier": 1
      }
    ],
    "weaponFireSuppressed": [
      {
        "soundEvent": "weaponFireSuppressed",
        "soundName": "epack.ak103.firesupp",
        "soundRange": 30,
        "soundMaxRange": 30,
        "soundFadeMultiplier": 1
      }
    ],
    "magIn": [
      {
        "soundEvent": "magIn",
        "soundName": "epack.ak103.magin"
      }
    ],
    "magOut": [
      {
        "soundEvent": "magOut",
        "soundName": "epack.ak103.magout"
      }
    ],
    "rack": [
      {
        "soundEvent": "rack",
        "soundName": "epack.ak103.rack"
      }
    ]
  }

While this may look complicated, you can actually copy this file and edit the fields instead of typing everything out from scratch. Make sure you update all the names for the model name, internal name, sounds, and the accepted ammo.