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.
You should have the following already installed on your machine:
- Minecraft (with purchased license)
- 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–18.104.22.1683-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-22.214.171.1243-mdk.zip -d ~/dev/minecraft-potion-mod cd ~/dev/minecraft-potion-mod git init git add . git commit -m 'initial commit' ./gradlew setupDecompWorkspace
Generate the project files
- Open IntelliJ IDEA
- Click “Open”
- Open the generated .ipr file. In my case, it’s
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.