All posts
August 7, 2026·4 min read

Your Own Minecraft Mod in Java: From Empty Project to a Working .jar

How to build your first Minecraft mod: MDK, JDK 21, Gradle, and project structure. Plus an honest look at what AI can actually do for this work and what you'll still have to do yourself.

Search "how to make a minecraft mod" and the results page is mostly paid courses. Everyone's selling training, and almost nobody shows the whole path.

The path itself is shorter than it looks. A working first .jar comes together in an evening once you know the order of steps.

What you'll need

JDK 21. Specifically 21, not 17 or 23: current Forge versions require it. Eclipse Temurin is the officially recommended build. Check your installed version with java -version.

MDK — the Mod Development Kit from Forge's site. It's an archive with a ready-made scaffold: gradle files and an src folder. Unpack it into an empty folder.

An IDE. IntelliJ IDEA or Eclipse — both have built-in Gradle integration, and when you open the project, they finish setting up the workspace on their own.

Your first build

The order matters here, so don't skip steps.

Unpack the MDK, open the folder in your IDE, and wait for Gradle to pull in dependencies. The first time is slow: it's downloading the engine itself and the libraries.

Next, generate run configurations — the command depends on your IDE:

gradlew genIntellijRuns

For Eclipse it's genEclipseRuns, for VS Code it's genVSCodeRuns.

Now edit build.gradle — without this, the mod stays a template:

  • base.archivesName = 'mymod' — the name of the resulting file;
  • group = 'com.example' — your package;
  • version = '1.21.1-1.0.0.0' — version, following the Maven scheme.

Build:

gradlew build

The finished .jar shows up in build/libs. That's your mod — you can drop it into a mods folder.

The first run of gradlew runServer exits right away. That's expected: you need to accept the license by editing eula.txt in the working folder. After that, the server comes up.

What comes next in practice

The scaffold is built, and now the actual modding starts: registering items and blocks, events, recipes, textures. From here everyone's path differs, and there's no universal order.

The one piece of general advice worth giving: build one thing at a time and test it in-game. A mod with twenty items added at once and nothing working takes three times longer to debug than one that grew one item at a time.

Can AI write a mod for you

Honest answer, since the question comes up a lot and the answer usually gets sold to you instead of given straight.

Mod generators that work from a description exist, and they genuinely handle simple things: an item with a texture, a basic block, a simple recipe. Ask for a sword that glows, you get a sword that glows.

It breaks down on the second iteration. And there's always a second iteration: a mod needs fixing. A generator doesn't know what's already in your project, can't see a compile error, can't rebuild the .jar and read the log. Every round turns into manually shuttling code back and forth, and by the third round it's faster to just write it yourself.

The difference isn't a smarter model, it's a different relationship to the project. An agent that sees the source, edits files in place, runs gradlew build, and reads the compile error is inside the development loop. A generator sits outside it, and from there, every edit costs manual work.

Typical tasks where this shows up: going through someone else's mod to understand how it's built; porting a mod to a new Minecraft version when half the API got renamed; finding why the .jar builds but the game doesn't see it; adding twenty similar items from one template.

Doka is that kind of agent: it works with files and the terminal, and the model can be local. Chances are you won't need it to invent what the mod should be, and it won't replace testing in-game. Compiling isn't the same as playing.

A mod, a server, and a data pack are different things

The mix-up is common, so briefly.

A mod changes the game's code, needs Forge or Fabric and Java. That's what this whole article is about.

A data pack changes data — recipes, loot, functions — with plain JSON files, no Java and no mods at all. A lot of what people start writing a mod for gets done with a data pack in half an hour: how to build one.

A server with mods is a separate task: setting up Forge and mods.

If your idea is new recipes, changed loot, or scripted events, start with a data pack. Java might come later, or maybe not at all.

Where to start

Install JDK 21, download the MDK, build an empty project, and confirm the .jar shows up in build/libs. No custom code yet. This step filters out most environment problems, and it's better to do it before your ideas show up.

From there, add one thing at a time. If you get stuck on a build error, download Doka and show it your project folder — sorting out Gradle errors is exactly the kind of work where an agent saves you an evening.