Konfig is a multiloader config library for Minecraft mods.
It gives you a typed API, side-aware config scopes (CLIENT, COMMON, SERVER), and built-in server to client sync for shared values.
push / pop)NONE, LOGIN, LOGIN_AND_RELOAD)config/<modid>/<name>.tomlmodmenu entrypoint)!konfig1.png
!konfig2.png
!konfig3.png
!konfig4.png
| Minecraft | Fabric | Forge | NeoForge |
|---|---|---|---|
| 1.21.11 | yes | yes | yes |
| 1.21.10 | yes | yes | yes |
| 1.21.1 | yes | yes | yes |
| 1.20.1 | yes | yes | no |
| 1.19.2 | yes | yes | no |
| 1.18.2 | yes | yes | no |
| 1.16.5 | yes | yes | no |
import com.iamkaf.konfig.api.v1.*;
public final class ExampleConfig {
public static final ConfigHandle HANDLE;
public static final ConfigValue<Boolean> ENABLED;
public static final ConfigValue<Integer> RANGE;
static {
ConfigBuilder builder = Konfig.builder("examplemod", "common")
.scope(ConfigScope.COMMON)
.syncMode(SyncMode.LOGIN)
.comment("Example mod config");
builder.push("general");
builder.categoryComment("General gameplay tuning");
ENABLED = builder.bool("enabled", true)
.comment("Master toggle")
.sync(true)
.build();
RANGE = builder.intRange("range", 8, 1, 64)
.comment("Effect radius")
.sync(true)
.restart(RestartRequirement.WORLD)
.build();
builder.pop();
HANDLE = builder.build();
}
}
Want to help translate this mod into your language? Join the community translation project:
Contribute translations
🇺🇸 🇪🇸 🇧🇷 🇫🇷 🇩🇪 🇷🇺 🇹🇷 🇯🇵 🇰🇷 🇨🇳
Q: Where can I ask something that is not listed here?
A: Make an issue here or join the Discord and shoot me a message.
Q: Can you port it to [MC version/Mod loader]?
A: If enough people request it I'll give it some time, but this really is a 1-man team so it might take a while.
Q: Can I include it in my modpack?
A: Yes, no need to give credit or ask.
|
Bonded |
Kaf's Valentine Special |
Liteminer |
Mochila |
Torch Toss |