ALKEARI
ContactDonate
Index
  1. Projects
  2. Releases
  3. Stats
  4. Community
  5. Help
  6. Roadmap
  7. Team
  8. Contact

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.

01

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:

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:

Terminal
gradlew modtrixInit -Pmod.name="My Cool Mod" -Pmod.group=com.yourname

3. Build every jar:

Terminal
gradlew release

The 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.

02

Artifacts

What this repository serves. Modtrix is not on the Gradle Plugin Portal, so this repository is where Gradle finds it.

ArtifactCoordinatesWhat It Is
Modtrixcom.alkeari.modtrix:modtrix-gradle-plugin:1.2.0The Gradle plugin, with the runtime API inside it
Settings plugincom.alkeari.modtrix:com.alkeari.modtrix.gradle.plugin:1.2.0Marker for plugin id com.alkeari.modtrix, applied in settings.gradle.kts
Node pluginscom.alkeari.modtrix.<node>:com.alkeari.modtrix.<node>.gradle.plugin:1.2.0Markers 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.

03

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.

Kotlin DSL
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.

04

Requirements

NeedsVersion
Gradle9.7.1 or newer (the starter project carries its wrapper)
JDK for Minecraft 1.20.1 to 1.20.417 or newer
JDK for Minecraft 1.20.5 to 1.21.1121 or newer
JDK for Minecraft 26.1 and later25

The JDK must be at least as new as the newest Minecraft version you target needs.

05

Configuration

Everything is set in your mod's root gradle.properties. modtrixInit writes this for you:

gradle.properties
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
KeyEffect
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.neoforgeThe Minecraft versions each loader builds. Each one becomes its own Gradle project.
modtrix.runtime=falseLeaves the runtime API out of your jars.

Lines that differ between Minecraft versions use Stonecutter comments in the shared sources:

Java
//? if >=1.21.11 {
/*import net.minecraft.resources.Identifier;
*///?} else
import net.minecraft.resources.ResourceLocation;
06

Tasks

TaskWhat It Does
modtrixInitWrites the starter project under your mod's identity (-Pmod.name, -Pmod.group, -Pmod.id), keeping any file already there
releaseBuilds every jar below into build/release/
fabricBundleOne Fabric jar holding a build for every targeted Minecraft version
forgeJar, neoforgeJarOne Forge or NeoForge jar that loads the build matching the running game
universalJarOne jar that runs on Fabric, Forge and NeoForge alike
07

Runtime API

The same calls on every loader, in package com.alkeari.modtrix.api.

ClassWhat It Covers
ModtrixWhich loader is running, which side, whether another mod is loaded, and client-only code
EventsCommands, server tick, server stopping, player join and client tick
Network, MessageTypeMessages from server to client and from client to server
RegistrarDeferred registration into any built-in registry, with Registrar.item and Registrar.block
ModConfigSettings 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
Java
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 -> { }));
08

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.

09

Modtrix

Version1.2.0
Gradle9.7.1 or newer
LicenseLGPL-3.0

Source Code Release 1.2.0