A template for a modular Minecraft Fabric mod with automatic mixin configuration generation and isolated optional mod support.
- Modular structure - separate modules for API, core implementation, mod integrations, and development environment
- Automatic mixin configuration generation - reduces boilerplate and potential errors
- Isolated modules for optional mod support - keeps the core module clean and manageable
- the root project - contains settings.gradle, gradle.properties, build.gradle.kts, etc. Responsible for merging
everything together upon build.
mod- parent module for everything that's working with the Minecraft code, Fabric API, etc.api- abstract layer of the mod, shouldn't contain mixins or other complex stuffcore- core implementation of the mod, contains mixins, all assets, mod support for required mods, etc.integrations- parent module for isolated mod support of optional mod dependenciesrunner- module for running the mod in a development environment, only relevant for development. Should only contain code for the development environment.
models- shared code between the mod modules and the annotation processor (primarily annotations)processor- annotation processor for automaticmixins.jsongeneration, etc.
- assets, fabric.mod.json, accesswidener ->
mod/core/src/main/resources - mod id ->
settings.gradle.kts(rootProject.name) - mod version ->
gradle.properties - minecraft, fabric-loader and fabric-loom version ->
gradle/libraries.versions.toml - fabric-api version & other mod dependencies ->
gradle/mod-dependencies.versions.toml - template for
mixins.jsonfiles ->processor/src/main/resources/default.mixins.json - development run configuration creation, dev auth configuration ->
mod/runner/build.gradle.kts
- Clone the repository
- Open the project in your favorite IDE (IntelliJ IDEA is recommended)
- Replace the value of
rootProject.nameinsettings.gradle.ktswith your desired mod id (don't forget to also update the access widener & assets directory to match the new mod id) - Update the mod name, description, author, etc. in
mod/core/src/main/resources/fabric.mod.json - Done. You can now start developing your mod!