Starting a new Minecraft mod
My kids are really into Minecraft, and are interested in mods. Here’s a quickstart to getting an OS X dev environment set up with IntelliJ IDEA.
Prereqs
You should have the following already installed on your machine:
- Minecraft (with purchased license)
- JDK
- IntelliJ IDEA
Get Forge Mod Development Kit (MDK)
- Go to the Minecraft Forge downloads page.
- In the “Download Recommended” section, click on the “Mdk” icon. You’ll be redirected to an ad-based download page.
- In a few seconds, you’ll see a red “SKIP” button in the top-right, click on
it to begin the download.
As of this writing, the recommended file is forge–1.8–11.14.4.1563-mdk.zip
Set up a folder for development
I’m calling mine ~/dev/minecraft-potion-mod
, since the initial mod I’m writing involves new potions. Here we extract it and create a new git repository:
mkdir ~/dev/minecraft-potion-mod
unzip ~/Downloads/forge-1.8-11.14.4.1563-mdk.zip -d ~/dev/minecraft-potion-mod
cd ~/dev/minecraft-potion-mod
git init
git add .
git commit -m 'initial commit'
./gradlew setupDecompWorkspace
IntelliJ
Generate the project files
./gradlew idea
- Open IntelliJ IDEA
- Click “Open”
- Open the generated .ipr file. In my case, it’s
/Users/lorin/dev/minecraft-potion-mod/minecraft-potion-mod.ipr
IDEA will likely show you pop-ups:
- Unregistered VCS root detected.
- Unlinked Gradle project?
These are safe to ignore. Alternately, you can register your root git and link the gradle projects so IDEA stops nagging you.
Run Minecraft with the mod
- In the menu bar, to the left of the (likely grayed out) “Run” button that looks
like a “play” triangle, click the drop-down, and choose “Minecraft Client”. - Click the (now active) “Run” button.
This should launch Minecraft. If you click the “Mods” button, it should say
“Example Mod” as one of the mods.
You’re now ready for Minecraft mod development.