This tutorial walks you through setting up a MultiLoader development environment from scratch. By the end you will have a working Gradle project that compiles and runs on both Fabric and NeoForge from a single shared codebase.
Installing JDK 21
Minecraft 1.21+ requires Java 21. Download and install the latest JDK 21 release from Oracle's JDK 21 download page. After installation, verify it is available on your PATH:
JAVA_HOME environment variable to take effect.Getting the Template
The easiest way to start a MultiLoader project is with the MultiLoader-Template maintained by jaredlll08. Click Use this template on GitHub to generate your own repository, or clone it directly:
The template contains three Gradle subprojects:
common: shared code that compiles against both loadersfabric: Fabric-specific entry points and dependenciesneoforge: NeoForge-specific entry points and dependencies
Configuring the Project
Open gradle.properties in the root directory and update the mod identity fields:
Also check settings.gradle to confirm the project name matches your mod:
mod_id must be all lowercase with no spaces or special characters. It is used as the namespace for all your registry names and resource paths, so choose it carefully.Setting Up IntelliJ IDEA
Open IntelliJ IDEA Community Edition and choose Open, then select the root folder of your cloned project (the one containing settings.gradle). IntelliJ will detect the Gradle project and begin importing.
Once imported, set the Gradle JVM to Java 21:
- Open File → Settings → Build, Execution, Deployment → Build Tools → Gradle
- Under Gradle JVM, select your JDK 21 installation
- Click OK, then click the Gradle refresh button to re-sync
Also set the Project SDK to Java 21 under File → Project Structure → Project → SDK.
Running the Project
After the Gradle sync completes you will see run configurations appear in the top-right dropdown of IntelliJ. There will be separate configurations for Fabric and NeoForge:
- Fabric Client / Fabric Server
- NeoForge Client / NeoForge Server
Run Fabric Client first to confirm the Fabric setup works, then run NeoForge Client. Both should launch a vanilla Minecraft instance with your (empty) mod loaded. If you see the game start without errors, your environment is ready.
Before moving on, rename the package structure in the fabric and neoforge subprojects to match the group you set in gradle.properties, and update the Constants class in the common project with your MOD_ID value.
mixin packages and their accompanying .mixins.json config files in each subproject to keep things tidy.I suggest you keep them in, as later in this series we will be covering the use of mixins.
Building Your Mod
To build your mod and produce the jars for release, all you need to do is run the build task from the gradle menu. This will build three jars, a common, neoforge and fabric jar for your mod. These will be located in each of the subproject's build/libs directories. For publication of your mod, you do not need to use the common jar, only the neoforge/fabric jars. The common jar is practical in other cases (i.e., if you are building an API), but for the purpose of this tutorial series we will not be covering this.
You can find the source for this tutorial here:
View Source on GitHubSetting Up RegistrationUtils
Add the RegistrationUtils Gradle plugin to your multiloader project, configure the fabric/neoforge/common project blocks, and get registration helpers ready for blocks and items.
Continue →