0.2.0-alpha.2+1.21.8
Compatibility
Required content
Changes
🧰 DevKit API 0.2.0-alpha.2
A focused update delivering version-resilient registry builders, command helpers, config reload, and several reliability fixes.
DevKit API is a lightweight library for Fabric mod developers. It provides reusable tools for registries, networking, Data Components, synchronized configuration, and data generation—without adding gameplay content of its own.
✨ Highlights
Version-Resilient Registry Builders
Item and block registration no longer requires version-specific code. The new ItemSettings and BlockSettings builders produce the same registration call on Minecraft 1.21.1, 1.21.8, and 1.21.11:
- a single
buildKeyed()call works everywhere; - on 1.21.1 the registry key is safely ignored;
- on 1.21.8 and newer it is applied automatically through internal version overrides;
buildSimple()remains available for cases where a plain supplier is preferred;- the existing
KRegister.register()overloads are unchanged — no breaking changes.
As a result, the per-version TestMod overrides for 1.21.8 and 1.21.11 have been removed. One source file now compiles on all three targets.
Command Helpers
DevkitCommands provides thin wrappers over Brigadier to reduce boilerplate when registering player commands:
- auto-registration through
CommandRegistrationCallback; player(ctx)unwrapsServerPlayerEntityfrom context;ok(ctx, message)andokBroadcast(ctx, message)return ready-to-use feedback;- compatible with the full Brigadier API —
literal(),argument(), and custom command trees work as usual.
Config Reload
ConfigManager.reload() rereads a JSON configuration file from disk and returns a fresh instance. The caller decides when to swap the live reference. A malformed file is never overwritten — the method falls back to in-memory defaults, matching the existing loadOrCreate() safety guarantees.
🔧 Fixes
- ModMenu library badge: replaced the non-functional flat key format with the correct nested
"modmenu": { "badges": ["library"] }structure. DevKit API now appears as a Library in Mod Menu. - Components.intComponent(String): the deprecated overload no longer passes a null identifier. It now defaults to the DevKit namespace, making
buildAndRegister()safe to call. - NetworkCompat:
reconfigureIfAvailable()is now called after server-authoritative configs are sent on player join. Previously the method existed but was never wired in. - TestMod: the example integration mod now exercises networking, config save, and config reload at runtime through live
/devkit_testcommands.
📦 For Developers
Dependent mods can consume DevKit API through Modrinth Maven:
repositories {
maven { url = "https://api.modrinth.com/maven/" }
}
dependencies {
modImplementation "maven.modrinth:devkitapi:0.2.0-alpha.2+1.21.8"
}
Maven Local publishing remains available as a fallback. See the README for full setup instructions.
Alpha software. Public API signatures may still change before 1.0.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:1Fq0uOtL:3P4BBQgW"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:1Fq0uOtL:3P4BBQgW"
}

