1.0.0
Compatibility
Changes
ConfigLib 1.0.0
Initial release. A lightweight config library for Fabric mods: define your options in code, get a working in-game config screen and JSON persistence for free.
Features
- In-game config screen: opened via a /<modid> client command, auto-registered from your Config. Tabbed by category, with an optional per-category index for tab ordering (unindexed categories sort after indexed ones, in discovery order).
- Sub-category headings: group related options within a tab under a vertical heading, inserted automatically wherever consecutive options' sub-category changes.
- Five option types: BOOL, NUM (unified int/float, stored as double), STR, ENUM (any Java enum, cycles through its constants), and LIST (heterogeneous, comma-separated, best-effort numeric parsing per element).
- Optional min/max: bounds a NUM option to a slider instead of a free-typed field.
- Key/display name split: key is the stable id used for storage and lookup, while displayName is what the screen shows, defaulting to key if omitted.
- Telescoping ConfigOption constructors: pass only what you need (category alone, category plus sub-category, min/max, etc.) without repeating the full field list.
- JSON persistence: Config.load()/save() round-trip options to <config dir>/<mod id>.json. A malformed file (bad syntax, or a type mismatch after an option's shape changed) is deleted and replaced with defaults rather than crashing the game at startup.
- Composite-build friendly: designed to be pulled in via includeBuild for local iteration without a publish step, alongside the usual Maven artifact for normal use.
Notes
LIST currently edits as one comma-joined text field. Per-entry input boxes and per-entry value bounds are on the way for a future release.
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:mSLJOMK2:r6okRYE0"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:mSLJOMK2:r6okRYE0"
}

