Fabric Example Mod: Build Your First Working Java Mod

Turn Fabric’s source template into a working mod JAR, see where the files belong, and make your first small change without disturbing your main game.

Content language

The most useful first mod is one you can build, find and launch again. Fabric’s example project gives you that starting point: a small source folder with the code, resources and build setup already connected. Your job is to turn that working starting point into one idea of your own.

What you get at the first launch

The untouched example does not add a new sword, machine or biome. Its first success is that the project builds and loads. Mod Menu is a separate helper that can show loaded mods; it is not a feature supplied by the template.

Fabric Example Mod loaded in Minecraft Java 26.2, selected in the in-game Mod Menu.

The unchanged 26.2 example, compiled into a JAR and loaded in a separate Fabric game. Searching for Example in Mod Menu makes it easy to find. Example Mod and Me! are the template’s placeholder name and author; you will replace them when you make the project your own.

Choose the source for the game you want to support

Open Files and choose the Minecraft target first. The new 26.2 source snapshot is the one used here. Earlier source snapshots remain available for their own game versions; use them if that is where your project needs to live.

For the 26.2 snapshot, use JDK 25. The older snapshots on this page have their own build requirements. Switching only the Minecraft number in a build file does not automatically update all the code and dependencies around it.

From source ZIP to a running mod

  1. Extract the source ZIP into a new development folder. Open the folder that actually contains build.gradle, gradlew.bat and gradle.properties. A downloaded repository archive can have an extra folder around them.
  2. Open a terminal in that folder. On Windows, run .\gradlew.bat build. On macOS or Linux, use ./gradlew build. Let the first run finish downloading its build dependencies.
  3. When the build finishes successfully, open build/libs. Choose the regular mod JAR. The -sources.jar contains source code and is not the file to install for ordinary play.
  4. Put the regular JAR in the mods folder of a matching Fabric instance. Install any dependencies declared by that example’s fabric.mod.json, then start that instance.
  5. Check that the example loads before changing its structure. Keep this first working build so you have something to compare with later.

For a separate development game, run .\gradlew.bat runClient on Windows or ./gradlew runClient on macOS/Linux. This is the template’s development launch, not a reason to copy source files into your everyday saves folder.

Make one recognizable change

Start with the display name and author in src/main/resources/fabric.mod.json, rebuild, and look for your new name in the mod list. It is a small change with an obvious result. Once that loop feels comfortable, move to your first item or other feature.

Renaming a mod ID is a bigger step than changing a display name: entrypoints, Java packages, resources and mixin references may depend on it. Keep those names consistent and make one change at a time. A tiny working feature is a better place to grow from than a large folder of half-connected changes.

If your idea needs a model or texture, our Blockbench walkthrough starts with a small lantern. Decide what the object does in your mod separately from how it looks.

When the first build gets stuck

  • Java version error: run .\gradlew.bat --version and check the JVM Gradle is actually using. Installing a new JDK does not always select it in your editor.
  • A dependency cannot be downloaded: read the first failed download and retry once the connection is available. Changing the ZIP’s extension will not help.
  • The JAR exists but the game cannot see it: check the launched instance, its Minecraft version and its loader. Our Fabric installation guide shows where the finished file belongs.
  • Nothing new appears in the world: the original example is a starting project, not a content pack. Check that it loads before expecting a feature you have not added yet.
No ratings yet

Files

Filter files Files: 4All release types
Show all files

Version 26.2-source-1ce1c77a

Stable

fabric-example-26.2-1ce1c77a.zip

0 downloads
Download · 62.7 KB
Requirements & details
  • File format: .zip

Source ZIP for Minecraft 26.2, not an installable mod. Extract it, use JDK 25, run the Gradle wrapper build, then install the regular resulting JAR in a matching Fabric instance.

Requirements & notes
Updating from an earlier release
Start a separate development folder for each game target. Keep the editable source and the finished JAR separately.

Version 1.21.1-source-684b5812

Stable

fabric-example-1.21.1.zip

0 downloads
Download · 64.6 KB
Requirements & details
  • File format: .zip

Version 1.20.1-source-cf6a5284

Stable

fabric-example-1.20.1.zip

2 downloads
Download · 64.6 KB
Requirements & details
  • File format: .zip

Version 1.19.2-source-3ea0867c

Stable

fabric-example-1.19.2.zip

2 downloads
Download · 64.6 KB
Requirements & details
  • File format: .zip

Release updates

Version 26.2-source-1ce1c77a

Stable

Pinned official Fabric example source for Minecraft 26.2. Built with JDK 25 and loaded as a regular JAR in the accompanying guide. Older source targets remain in the history.

View files

Version 1.21.1-source-684b5812

Stable

Source snapshot for Minecraft 1.21.1; the upstream project does not assign this branch a numbered release.

Source: Fabric Example Mod source files
Compatibility details below reflect targets declared by the author. See the linked source for complete version and device information.

View files

Version 1.20.1-source-cf6a5284

Stable

Source snapshot for Minecraft 1.20.1; the upstream project does not assign this branch a numbered release.

Source: Fabric Example Mod source files
Compatibility details below reflect targets declared by the author. See the linked source for complete version and device information.

View files

Version 1.19.2-source-3ea0867c

Stable

Source snapshot for Minecraft 1.19.2; the upstream project does not assign this branch a numbered release.

Source: Fabric Example Mod source files
Compatibility details below reflect targets declared by the author. See the linked source for complete version and device information.

View files

Comments 0

Share what worked, ask for help or reply to another player.

Join the conversation

1Your name & email

No account required. Confirm your email with a code before your first comment. Only a masked address appears with your name. Guest comments are reviewed before publication.

2Verify & post

No comments yet. Share what worked for you.

Search Modonix

Search in