Config Screens
Register small Minecraft config screens with categories, boolean options, integer options and save callbacks.
Config Screens
Nows includes a small config screen layer for mods that only need common settings UI instead of depending directly on Cloth Config or a loader-specific mod menu integration.
Register a config screen factory during initialization:
MinecraftApi.configUi(context).register("my_mod", parent ->
MinecraftApi.configUi(context)
.screen(McText.literal("My Mod Settings"))
.category(McText.literal("General"))
.booleanOption(
McText.translatable("option.my_mod.enabled"),
MyConfig.enabled(),
true,
McText.translatable("option.my_mod.enabled.tooltip"),
MyConfig::setEnabled)
.intOption(
McText.translatable("option.my_mod.cooldown"),
MyConfig.cooldown(),
1000,
0,
60000,
McText.translatable("option.my_mod.cooldown.tooltip"),
MyConfig::setCooldown)
.done()
.saving(MyConfig::save)
.build());
The built-in Nows mod list opens registered config screens from its Configure button. This covers the small, common Cloth Config pattern: category, boolean toggle, integer field, default/reset and save callback. McText is translated by each adapter into that Minecraft version’s text/component API. More complex screens can still be custom Minecraft Screen classes returned by the registered factory.
Builder Model
The config screen builder creates a ConfigScreenSpec with:
| Part | Details |
|---|---|
| parent screen | the screen Minecraft should return to when the config screen closes |
| title | a stable McText value shown by the generated screen |
| categories | ordered ConfigCategorySpec entries |
| options | boolean and integer option specs |
| saving callback | a final Runnable called when the screen saves |
Boolean options store the current value, default value, tooltip text and save consumer. Integer options add min and max bounds. The generated screen handles reset/default behavior for these simple values.
When To Use It
Use this layer for settings like toggles, cooldowns, limits, UI preferences and simple client/server config values. Keep the actual persistence in your own config class, then call .saving(MyConfig::save) so the screen only owns UI state.
For custom widgets, nested lists, keybind editors, color pickers, preview panes or anything with custom rendering, register a factory that returns your own Minecraft Screen instead of forcing the small builder to do more than it should.