- Conventions and Terminology
- Development Tools
If you are using IntelliJ IDEA you can use the MinecraftDev plugin. This plugin adds support for automatically generating Fabric projects as well as some mixin related features like inspections, generating accessors/shadow fields, and copying Mixin Target References (JVM Descriptors). You can install it using IntelliJ's internal plugin browser by navigating to File → Settings → Plugins, then clicking the Marketplace tab and searching for Minecraft.
There are two main ways to make a new mod for Minecraft based on Fabric. You can either manually download fabric-example-mod and setup by yourself, or use automatic tools for you.
NOTE: The default template in the mcdev plugin blindly uses the latest unstable version of the loom. Use with caution.
maven_groupto your preferred values.
If you are unable to use the mc plugin or the fabric-example-mod, you may also use GeneratorFabricMod by ExtraCrafTX, a convenient tool to automatically generate new fabric mods from template. Follow these steps:
If you are using IntelliJ IDEA by JetBrains, please follow these steps:
Optional, but recommended: By default, IntelliJ delegates to Gradle to build the project. This is unnecessary for Fabric and causes longer build times and hotswapping related weirdness, among other problems. To make it use the builtin compiler:
Unfortunately, it is currently impossible to set an IDE-wide default for the 'Build and run using' and 'Run tests using' options, so these steps have to be repeated for every new project.
NOTE: Don't run the
idea gradle task. It is known to break development environment.
If you are using Eclipse and you would like to have the IDE run configs you can run
gradlew eclipse. The project can then be imported as a normal (non-gradle) Eclipse project into your workspace using the 'File' - 'Import…' menu, then 'General' → 'Existing Projects into Workspace'.
If you are using VSCode, please follow these instructions.
Reading the Minecraft source is an essential part of modding. Unfortunately, we can't publish the Minecraft source because it violates the Minecraft EULA. You need to generate the Minecraft source yourself.
To generate the Minecraft source. run the
genSources gradle task.
If your IDE doesn't have gradle integration, run the following command in the terminal:
gradlew genSources (or
./gradlew genSources on Linux/MacOS).
It can take a while depending on your computer power.
You may need to refresh gradle after running the task.
See Reading the Minecraft source for how to read the source.
gradlew cleanloom. Running
gradlew --stopcan also help with a few rare issues.
Sometimes, when importing the Gradle project into an IDE, the assets might not download correctly. In this case, run the
downloadAssets task manually - either using IDE's built-in menu or by simply running