Client Config Screens
Register simple config screens or native config factories through the mc adapter client/config package.
Some APIs may still change or behave unevenly because they do not have enough real-world use cases and test coverage yet.
Client Config Screens
The config UI API lives in space.nows.mc.api.client.config. Use it when a mod should expose a Configure button in the Nows mod list.
Register A Simple Screen
ConfigUi.screen(...) creates a ConfigScreenBuilder. The builder currently supports boolean and integer options, grouped into categories.
ConfigUi config = MinecraftApi.configUi(context);
config.register("my_mod", parent -> config
.screen(parent, McText.translatable("screen.my_mod.config"))
.category("General")
.booleanOption(
"Enabled",
MyConfig.enabled,
true,
"Enable machine behavior",
value -> MyConfig.enabled = value)
.intOption(
"Speed",
MyConfig.speed,
4,
1,
16,
"Machine speed",
value -> MyConfig.speed = value)
.done()
.saving(MyConfig::save)
.build());
The factory receives the parent screen. Always pass that parent into screen(parent, title) so Back/Done returns to the right place.
Option Values
ConfigOptionSpec stores current value, default value, optional min/max range and a save callback.
Use booleanOption for toggles:
category.booleanOption("Particles", enabled, true, "Show machine particles",
value -> MyConfig.particles = value);
Use intOption for bounded numbers:
category.intOption("Range", range, 8, 1, 64, "Scan range",
value -> MyConfig.range = value);
The screen calls each option’s save callback, then runs the builder’s saving(...) runnable.
Native Config Screens
If your mod already has a native screen, register a ConfigScreenFactory directly.
MinecraftApi.configUi(context).register(
"my_mod",
parent -> new MyConfigScreen(parent));
Use this path for complex layouts, custom widgets, previews or controls beyond booleans and integers.
Lookup
has(modId) and create(modId, parent) are useful for mod-list screens or diagnostics.
ConfigUi config = MinecraftApi.configUi(context);
if (config.has("my_mod")) {
config.create("my_mod", parent).ifPresent(client::setScreen);
}