Cloche Fundamentals
Terrarium Cloche is a Gradle plugin for building Minecraft mods across multiple mod loaders (Fabric, NeoForge, Forge) and multiple Minecraft versions inside a single Gradle project.
Instead of splitting your mod into :common, :fabric, and :neoforge subprojects — each with its own toolchain plugin — Cloche models loaders and versions as targets inside one Gradle project, inspired by Kotlin Multiplatform (kotlin { jvm(); js(); commonMain }).
The core idea in 30 seconds
In a Cloche project:
- You declare leaf targets (
fabric,neoforge,forge), each pinned to a specific Minecraft version and loader version. - You declare common targets (
common, or namedcommon("...")intermediates) that hold code shared across some or all leaf targets. - You connect them into a directed acyclic graph (DAG) with
dependsOn(...). - For every common target, Cloche computes the intersection of Minecraft and loader APIs available across all leaf targets that depend on it, generates a compile-only API stub JAR, and compiles the common source set against that stub.
- Each leaf target compiles its own sources alongside the compiled common classes, applies mixins / access wideners / access transformers, and outputs a ready-to-run mod JAR.
What this section covers
- Targets & API Stubs — How
common,fabric,neoforge,dependsOn(...),singleTarget, and Cloche'sGenerateStubApiintersection work. - Dependencies, Runs & Publishing —
ClocheDependencyHandler, repositories,fabricApi(...),include(...), client/server runs, IntelliJ sync, and Gradle Module Metadata publishing. - ClassTweaker, Mixins & Known Quirks — Access Wideners, Access Transformers, Mixin configuration, unobfuscated Minecraft
26.xnamespaces, and Cloche0.19.xedge cases (and how Graft handles them).
Cloche version
These docs reflect Terrarium Cloche 0.19.13 (with minecraft-codev 0.6.x–0.9.x) targeting unobfuscated Minecraft 26.1+ as well as earlier mapped versions.