maven.alkeari.com
Maven Repository
Home of Modtrix, a Gradle plugin and runtime API that builds one Minecraft mod source tree for Fabric, Forge and NeoForge across Minecraft 1.12.2 to 26.3.
Quick Start
Start a new mod that builds for Fabric, Forge and NeoForge in three steps.
1. In an empty folder holding the Gradle wrapper, write settings.gradle.kts:
pluginManagement {
repositories {
maven("https://maven.alkeari.com")
gradlePluginPortal()
maven("https://maven.fabricmc.net/")
}
}
plugins {
id("com.alkeari.modtrix") version "1.2.0"
}2. Generate the project under your mod's name and group:
gradlew modtrixInit -Pmod.name="My Cool Mod" -Pmod.group=com.yourname3. Build every jar:
gradlew releaseThe jars land in build/release/: one per loader, and one universal jar that runs on all three. Commit the versions/<version>/gradle.properties files the first build wrote: they pin Fabric Loader, Fabric API, Forge, NeoForge and Parchment for each Minecraft version until you change them.
Artifacts
What this repository serves. Modtrix is not on the Gradle Plugin Portal, so this repository is where Gradle finds it.
| Artifact | Coordinates | What It Is |
|---|---|---|
| Modtrix | com.alkeari.modtrix:modtrix-gradle-plugin:1.2.0 | The Gradle plugin, with the runtime API inside it |
| Settings plugin | com.alkeari.modtrix:com.alkeari.modtrix.gradle.plugin:1.2.0 | Marker for plugin id com.alkeari.modtrix, applied in settings.gradle.kts |
| Node plugins | com.alkeari.modtrix.<node>:com.alkeari.modtrix.<node>.gradle.plugin:1.2.0 | Markers for com.alkeari.modtrix.common, .fabric, .forge and .neoforge, which modtrixInit applies for you |
The runtime API has no artifact of its own: the plugin bundles it into each mod's jar under the mod's own package, so players install nothing extra.
Use the Repository
A Gradle plugin is resolved through pluginManagement in settings.gradle.kts. Keep the Fabric Maven there either way, since Fabric Loom is published only there.
pluginManagement {
repositories {
maven("https://maven.alkeari.com")
gradlePluginPortal()
maven("https://maven.fabricmc.net/")
}
}The repository uses the standard Maven layout, so a file's address is its group with dots as slashes, then the artifact and version: https://maven.alkeari.com/com/alkeari/modtrix/modtrix-gradle-plugin/1.2.0/. It has no folder listing.
Requirements
| Needs | Version |
|---|---|
| Gradle | 9.7.1 or newer (the starter project carries its wrapper) |
| JDK for Minecraft 1.20.1 to 1.20.4 | 17 or newer |
| JDK for Minecraft 1.20.5 to 1.21.11 | 21 or newer |
| JDK for Minecraft 26.1 and later | 25 |
The JDK must be at least as new as the newest Minecraft version you target needs.
Configuration
Everything is set in your mod's root gradle.properties. modtrixInit writes this for you:
mod.id=mymod
mod.name=My Mod
mod.version=1.0.0
mod.group=com.example
mod.archives_name=MyMod
mod.author=Your Name
mod.license=All-Rights-Reserved
mod.description=What your mod does, in one sentence.
targets.common=1.20.1, 1.21.1
targets.fabric=1.20.1, 1.21.1
targets.forge=1.20.1
targets.neoforge=1.21.1| Key | Effect |
|---|---|
mod.* | Your mod's identity, used to generate fabric.mod.json, mods.toml and neoforge.mods.toml. Write your own file in a loader's src/main/resources to use it instead. |
targets.fabric, targets.forge, targets.neoforge | The Minecraft versions each loader builds. Each one becomes its own Gradle project. |
modtrix.runtime=false | Leaves the runtime API out of your jars. |
Lines that differ between Minecraft versions use Stonecutter comments in the shared sources:
//? if >=1.21.11 {
/*import net.minecraft.resources.Identifier;
*///?} else
import net.minecraft.resources.ResourceLocation;Tasks
| Task | What It Does |
|---|---|
modtrixInit | Writes the starter project under your mod's identity (-Pmod.name, -Pmod.group, -Pmod.id), keeping any file already there |
release | Builds every jar below into build/release/ |
fabricBundle | One Fabric jar holding a build for every targeted Minecraft version |
forgeJar, neoforgeJar | One Forge or NeoForge jar that loads the build matching the running game |
universalJar | One jar that runs on Fabric, Forge and NeoForge alike |
Runtime API
The same calls on every loader, in package com.alkeari.modtrix.api.
| Class | What It Covers |
|---|---|
Modtrix | Which loader is running, which side, whether another mod is loaded, and client-only code |
Events | Commands, server tick, server stopping, player join and client tick |
Network, MessageType | Messages from server to client and from client to server |
Registrar | Deferred registration into any built-in registry, with Registrar.item and Registrar.block |
ModConfig | Settings declared once, kept in config/<modid>.toml, with a settings screen opened from Mod Menu on Fabric and the Config button on Forge and NeoForge |
ModConfig.Builder settings = ModConfig.builder(MOD_ID);
ModConfig.Value<Integer> pingValue = settings.comment("Number sent to each joining player.")
.defineInt("ping_value", 42, 0, 1000);
ModConfig config = settings.build();
Supplier<Item> widget = Registrar.item(Registrar.create(MOD_ID, Registries.ITEM), "widget", Item::new);
MessageType<Ping> ping = Network.toClient(id("ping"), Ping.class,
(message, buf) -> buf.writeVarInt(message.value()), buf -> new Ping(buf.readVarInt()),
message -> LOGGER.info("Received {}", message.value()));
Events.onPlayerJoin(player -> ping.sendTo(player, new Ping(pingValue.get())));
Modtrix.onClient(() -> Events.onClientTick(client -> { }));Compatibility
Builds mods for Minecraft 1.12.2 through 26.3: Fabric on every version, Forge and NeoForge on every version each loader publishes a build for.
Modtrix
| Version | 1.2.0 |
|---|---|
| Gradle | 9.7.1 or newer |
| License | LGPL-3.0 |