{"slug":"minecraft-multiloader-2","title":"minecraft-multiloader","summary":"Build and maintain Architectury-based Minecraft 26.x or 1.21.x mods that share one codebase across NeoForge and Fabric. Use only when both loaders are required; use minecraft-modding for a single-loader project.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-07T18:38:47.946355Z","repo":{"url":"https://github.com/Jahrome907/minecraft-agent-skills","stars":151,"forks":9,"license":"MIT","updatedAt":"2026-09-13T05:52:30Z"},"bodyHtml":"<hr>\n<h2>name: minecraft-multiloader\ndescription: \"Build and maintain Architectury-based Minecraft 26.x or 1.21.x mods that share one codebase across NeoForge and Fabric. Use only when both loaders are required; use minecraft-modding for a single-loader project.\"</h2>\n<h1>Minecraft Multiloader Skill (Architectury)</h1>\n<h2>What Is Architectury?</h2>\n<p><a href=\"https://github.com/architectury/architectury-api\">Architectury</a> is a framework that\nlets you write one mod codebase that compiles to both <strong>NeoForge</strong> and <strong>Fabric</strong> JARs.\nThe common subproject has a shared API; platform subprojects implement\nplatform-specific behavior behind the <code>@ExpectPlatform</code> abstraction.</p>\n<h3>Routing Boundaries</h3>\n<ul>\n<li><code>Use when</code>: one shared codebase must build and ship both NeoForge and Fabric artifacts.</li>\n<li><code>Do not use when</code>: the project is single-loader only (<code>minecraft-modding</code> for NeoForge/Fabric, not both).</li>\n<li><code>Do not use when</code>: the task is Paper/Bukkit plugin development (<code>minecraft-plugin-dev</code>).</li>\n</ul>\n<table>\n<thead>\n<tr>\n<th>Component</th>\n<th>Purpose</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>architectury-loom</code></td>\n<td>Gradle plugin — extends Fabric Loom for multiloader support</td>\n</tr>\n<tr>\n<td><code>architectury-api</code></td>\n<td>Runtime library — abstractions over both platforms</td>\n</tr>\n<tr>\n<td><code>@ExpectPlatform</code></td>\n<td>Annotation marking methods with platform-specific implementations</td>\n</tr>\n<tr>\n<td><code>common/</code></td>\n<td>Shared code (no loader-specific APIs)</td>\n</tr>\n<tr>\n<td><code>fabric/</code></td>\n<td>Fabric-specific code + entrypoint</td>\n</tr>\n<tr>\n<td><code>neoforge/</code></td>\n<td>NeoForge-specific code + entrypoint</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>Versions (Retained 1.21.11 Lane)</h2>\n<pre><code># gradle.properties property names used by this skill's static helper.\n# Get every tool version from the exact generated or known-working project.\nmod_version=1.0.0\nminecraft_version=1.21.11\nenabled_platforms=fabric,neoforge\n\narchitectury_version=&lt;project pin&gt;\nfabric_loader_version=&lt;project pin&gt;\nfabric_api_version=&lt;project pin ending in +1.21.11&gt;\nneoforge_version=&lt;project pin in the 21.11.x family&gt;\nloom_version=&lt;project pin&gt;\n</code></pre>\n<p>Pin <code>architectury_version</code>, the Architectury plugin version, and <code>loom_version</code>\nfrom the same generated or known-working project line. This skill deliberately\ndoes not publish a copyable dependency matrix: its static helper cannot resolve\nwhether a particular set of versions is compatible.</p>\n<p>For the current Minecraft 26.2 / Java 25 lane, use the official\n<a href=\"https://generate.architectury.dev/\">Architectury Template Generator</a> only when\nits version selector offers the exact target. Generate a <strong>Multiplatform</strong>\nproject with Fabric and NeoForge, then preserve the generated Gradle layout and\npins as one set. If the generator does not offer the target, begin with an\nalready working project on that exact line and inspect its resolved build; do\nnot relabel a 1.21.11 template as 26.2. The published template downloads are\nnot a substitute for an exact-current scaffold.</p>\n<p>Do not mechanically change only <code>minecraft_version</code> in the retained example:\n26.2 is unobfuscated and its Loom/remapping setup differs from 1.21.11.</p>\n<h2>Bundled References And Helpers</h2>\n<ul>\n<li>Version alignment reference: <code>references/architectury-reference.md</code></li>\n<li>Sanity checker: <code>./scripts/check-version-sanity.sh --root &lt;project&gt;</code></li>\n</ul>\n<p>Run the sanity checker after editing <code>gradle.properties</code>. It is a static\nsyntax-and-version-family preflight: it catches missing keys, snapshot pins,\nmissing <code>fabric</code> / <code>neoforge</code> platforms, and obvious version-family drift. It\ndoes not resolve dependencies, prove loader compatibility, or replace the\nproject's Fabric and NeoForge build and smoke tests.</p>\n<hr>\n<h2>Root Project Layout</h2>\n<pre><code>my-mod/\n├── build.gradle           ← root build (shared config)\n├── settings.gradle\n├── gradle.properties\n├── common/\n│   ├── build.gradle\n│   └── src/main/java/com/example/mymod/\n│       ├── MyMod.java               ← shared init\n│       ├── registry/\n│       │   └── ModItems.java        ← shared registry declarations\n│       └── platform/\n│           └── PlatformHelper.java  ← @ExpectPlatform methods\n├── fabric/\n│   ├── build.gradle\n│   └── src/main/\n│       ├── java/com/example/mymod/fabric/\n│       │   ├── MyModFabric.java          ← Fabric entrypoint\n│       ├── java/com/example/mymod/platform/\n│       │   └── PlatformHelperImpl.java   ← Fabric @ExpectPlatform implementation\n│       └── resources/\n│           ├── fabric.mod.json\n│           └── assets/...\n└── neoforge/\n    ├── build.gradle\n    └── src/main/\n        ├── java/com/example/mymod/neoforge/\n        │   ├── MyModNeoForge.java        ← NeoForge @Mod entry\n        ├── java/com/example/mymod/platform/\n        │   └── PlatformHelperImpl.java   ← NeoForge @ExpectPlatform implementation\n        └── resources/\n            ├── META-INF/neoforge.mods.toml\n            └── assets/...\n</code></pre>\n<hr>\n<h2>Legacy Build Template</h2>\n<p>The old fixed Gradle scripts were a 1.21.11 snapshot and are intentionally not\npresented as a current scaffold. For either supported lane, read\n<a href=\"references/legacy-1.21.11-template.md\"><code>references/legacy-1.21.11-template.md</code></a>\nor <a href=\"references/architectury-reference.md\"><code>references/architectury-reference.md</code></a>\nbefore changing generated build files. They preserve version anchors and\nsource-set boundaries without encouraging a partial build script to be copied\ninto a different Minecraft line.</p>\n<hr>\n<h2>Shared Common Code</h2>\n<h3><code>common/.../MyMod.java</code></h3>\n<pre><code>package com.example.mymod;\n\nimport dev.architectury.registry.registries.DeferredRegister;\nimport dev.architectury.registry.registries.RegistrySupplier;\nimport net.minecraft.core.registries.Registries;\nimport net.minecraft.resources.Identifier;\nimport net.minecraft.resources.ResourceKey;\nimport net.minecraft.world.item.Item;\n\npublic class MyMod {\n    public static final String MOD_ID = \"mymod\";\n\n    // Architectury's DeferredRegister — works on both platforms\n    public static final DeferredRegister&lt;Item&gt; ITEMS =\n        DeferredRegister.create(MOD_ID, Registries.ITEM);\n\n    public static final RegistrySupplier&lt;Item&gt; MY_ITEM =\n        ITEMS.register(\"my_item\", () -&gt; new Item(new Item.Properties().setId(\n            ResourceKey.create(Registries.ITEM,\n                Identifier.fromNamespaceAndPath(MOD_ID, \"my_item\"))\n        )));\n\n    public static void init() {\n        ITEMS.register(); // registers with both platforms\n    }\n}\n</code></pre>\n<h3><code>@ExpectPlatform</code> — platform-specific methods</h3>\n<p>Define the contract in <code>common/</code>:</p>\n<pre><code>package com.example.mymod.platform;\n\nimport dev.architectury.injectables.annotations.ExpectPlatform;\nimport net.minecraft.world.level.material.Fluid;\n\npublic class PlatformHelper {\n\n    @ExpectPlatform\n    public static boolean isModLoaded(String modId) {\n        // This body is replaced at compile time by the platform implementation\n        throw new AssertionError(\"ExpectPlatform implementation not found\");\n    }\n\n    @ExpectPlatform\n    public static boolean isClient() {\n        throw new AssertionError();\n    }\n}\n</code></pre>\n<p>Keep each platform implementation in the same Java package as the common\n<code>@ExpectPlatform</code> class. Only the source set changes between <code>common/</code>,\n<code>fabric/</code>, and <code>neoforge/</code>.</p>\n<p>Implement in <code>fabric/.../platform/PlatformHelperImpl.java</code>:</p>\n<pre><code>package com.example.mymod.platform;\n\nimport net.fabricmc.loader.api.FabricLoader;\n\n// Class name must match: &lt;common class name&gt;Impl\npublic class PlatformHelperImpl {\n\n    public static boolean isModLoaded(String modId) {\n        return FabricLoader.getInstance().isModLoaded(modId);\n    }\n\n    public static boolean isClient() {\n        return FabricLoader.getInstance().getEnvironmentType() ==\n            net.fabricmc.api.EnvType.CLIENT;\n    }\n}\n</code></pre>\n<p>Implement in <code>neoforge/.../platform/PlatformHelperImpl.java</code>:</p>\n<pre><code>package com.example.mymod.platform;\n\nimport net.neoforged.fml.ModList;\nimport net.neoforged.fml.loading.FMLEnvironment;\n\npublic class PlatformHelperImpl {\n\n    public static boolean isModLoaded(String modId) {\n        return ModList.get().isLoaded(modId);\n    }\n\n    public static boolean isClient() {\n        return FMLEnvironment.dist.isClient();\n    }\n}\n</code></pre>\n<hr>\n<h2>Fabric Entrypoint</h2>\n<h3><code>fabric/.../MyModFabric.java</code></h3>\n<pre><code>package com.example.mymod.fabric;\n\nimport com.example.mymod.MyMod;\nimport net.fabricmc.api.ModInitializer;\n\npublic class MyModFabric implements ModInitializer {\n    @Override\n    public void onInitialize() {\n        MyMod.init();\n    }\n}\n</code></pre>\n<h3><code>fabric/.../resources/fabric.mod.json</code></h3>\n<p>This retained-1.21.11 metadata example follows the minimum dependencies in the\n<a href=\"https://github.com/architectury/architectury-api/tree/1.21.11\">upstream Architectury 1.21.11 branch</a>.\nKeep the generated project's exact ranges when they are stricter.</p>\n<pre><code>{\n  \"schemaVersion\": 1,\n  \"id\": \"mymod\",\n  \"version\": \"${version}\",\n  \"name\": \"My Mod\",\n  \"description\": \"A multiloader example mod\",\n  \"license\": \"MIT\",\n  \"environment\": \"*\",\n  \"entrypoints\": {\n    \"main\": [\"com.example.mymod.fabric.MyModFabric\"]\n  },\n  \"depends\": {\n    \"fabricloader\": \"&gt;=0.18.2\",\n    \"fabric-api\": \"&gt;=0.139.4+1.21.11\",\n    \"architectury\": \"&gt;=19.0\",\n    \"minecraft\": \"~1.21.11\"\n  }\n}\n</code></pre>\n<hr>\n<h2>NeoForge Entrypoint</h2>\n<h3><code>neoforge/.../MyModNeoForge.java</code></h3>\n<pre><code>package com.example.mymod.neoforge;\n\nimport com.example.mymod.MyMod;\nimport net.neoforged.bus.api.IEventBus;\nimport net.neoforged.fml.common.Mod;\n\n@Mod(MyMod.MOD_ID)\npublic class MyModNeoForge {\n    public MyModNeoForge(IEventBus modEventBus) {\n        MyMod.init();\n    }\n}\n</code></pre>\n<h3><code>neoforge/.../resources/META-INF/neoforge.mods.toml</code></h3>\n<pre><code>modLoader = \"javafml\"\nloaderVersion = \"[1,)\"\nlicense = \"MIT\"\n\n[[mods]]\nmodId = \"mymod\"\nversion = \"${file.jarVersion}\"\ndisplayName = \"My Mod\"\ndescription = \"A multiloader example mod\"\n\n[[dependencies.mymod]]\nmodId = \"neoforge\"\ntype = \"required\"\nversionRange = \"[21.11,)\"\nordering = \"NONE\"\nside = \"BOTH\"\n\n[[dependencies.mymod]]\nmodId = \"minecraft\"\ntype = \"required\"\nversionRange = \"[1.21.11,1.22)\"\nordering = \"NONE\"\nside = \"BOTH\"\n</code></pre>\n<hr>\n<h2>Build Commands</h2>\n<pre><code># Build both JARs simultaneously\n./gradlew build\n\n# Inspect the project's actual outputs. Generated templates choose their own\n# archive base name and version convention:\nfind fabric/build/libs neoforge/build/libs -maxdepth 1 -type f -name '*.jar' \\\n  ! -name '*-sources.jar' ! -name '*-dev.jar' ! -name '*-javadoc.jar'\n\n# Run in dev environment\n./gradlew :fabric:runClient\n./gradlew :neoforge:runClient\n./gradlew :neoforge:runServer\n\n# Datagen (if applicable)\n./gradlew :neoforge:runData\n</code></pre>\n<hr>\n<h2>Common Pitfalls</h2>\n<table>\n<thead>\n<tr>\n<th>Pitfall</th>\n<th>Solution</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Using <code>net.neoforged.*</code> / <code>net.fabricmc.*</code> in <code>common/</code></td>\n<td>Only use vanilla MC and Architectury APIs in common</td>\n</tr>\n<tr>\n<td>Direct field access on <code>DeferredRegister</code> (NeoForge style) in common</td>\n<td>Use Architectury's <code>DeferredRegister</code></td>\n</tr>\n<tr>\n<td>Constructing a 26.2 item without a registry key</td>\n<td>Create its <code>ResourceKey&lt;Item&gt;</code> and call <code>Item.Properties#setId</code> before <code>new Item</code></td>\n</tr>\n<tr>\n<td>Forgetting <code>@ExpectPlatform</code> throws <code>AssertionError</code> at runtime</td>\n<td>Both <code>fabric/</code> and <code>neoforge/</code> must have matching same-package <code>*Impl</code> classes</td>\n</tr>\n<tr>\n<td>Assets duplicated in fabric/ and neoforge/</td>\n<td>Keep assets in <code>common/src/main/resources/assets/</code></td>\n</tr>\n<tr>\n<td>A common Mixin imports a loader API or targets one loader's side</td>\n<td>Put it in that platform subproject; loader-neutral Mixins may be common when both generated platform configurations include them</td>\n</tr>\n<tr>\n<td>Accessing world/registry on mod init thread</td>\n<td>Use <code>mod bus</code> events for setup; never access world on init</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>References</h2>\n<ul>\n<li>Architectury API GitHub: <a href=\"https://github.com/architectury/architectury-api\">https://github.com/architectury/architectury-api</a></li>\n<li>Architectury API 26.2 source branch: <a href=\"https://github.com/architectury/architectury-api/tree/26.2\">https://github.com/architectury/architectury-api/tree/26.2</a></li>\n<li>Architectury API 1.21.11 source branch: <a href=\"https://github.com/architectury/architectury-api/tree/1.21.11\">https://github.com/architectury/architectury-api/tree/1.21.11</a></li>\n<li>Architectury Loom: <a href=\"https://github.com/architectury/architectury-loom\">https://github.com/architectury/architectury-loom</a></li>\n<li>Architectury templates: <a href=\"https://github.com/architectury/architectury-templates\">https://github.com/architectury/architectury-templates</a></li>\n<li>Architectury Template Generator: <a href=\"https://generate.architectury.dev/\">https://generate.architectury.dev/</a></li>\n<li>Architectury docs: <a href=\"https://docs.architectury.dev/\">https://docs.architectury.dev/</a></li>\n</ul>\n","files":[{"path":"references/architectury-reference.md","sizeBytes":2801,"isText":true},{"path":"references/legacy-1.21.11-template.md","sizeBytes":2645,"isText":true},{"path":"scripts/check-version-sanity.sh","sizeBytes":4638,"isText":true},{"path":"SKILL.md","sizeBytes":12139,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-16T15:59:53.508912Z","sha256":"D3A06C5E0E06A2D694566AB627AC729FB33D39C7DC89FEE69C0FA956ABFBD1C8","sizeBytes":8870},"review":null,"source":{"repositoryUrl":"https://github.com/Jahrome907/minecraft-agent-skills","path":".claude/skills/minecraft-multiloader","license":"MIT","commit":"dd57c5a97741cdc0eb5bb3a8f876581a4f09eeb0","subtreeSha":"DA06A2D0545AC8A259FA2A3B133068C2C632BC29F6793C47EF020ACFB7142216","lastSyncedAt":"2026-09-25T06:49:17.478439Z"},"reviewedAt":"2026-09-16T16:00:54.428313Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/Jahrome907/minecraft-agent-skills/tree/main/.claude/skills/minecraft-multiloader"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install jahrome907-minecraft-agent-skills@llmmart"},{"target":"git","command":"git clone https://github.com/Jahrome907/minecraft-agent-skills.git"}]}