ConfigGroup¶
abstract class ConfigGroup(val title: Component, val id: String = title.string.toSnakeCase()) : ConfigNode
A folder grouping other ConfigNodes (config specs, nested groups, and collections), declared as a nested singleton object inside a ConfigContainer or another ConfigGroup:
object Config : ConfigContainer(MyMod.MOD) {
object Gui : ConfigGroup(Component.literal("GUI")) {
object Theme : ConfigSpec.Client(MyMod.MOD) { ... } // -> config/mymod/gui/theme.json5
}
}
children are discovered the same way ConfigContainer.children discovers its own - by reflecting over nested objects - so there's nothing to override or register manually. This group's id becomes one path segment for every ConfigSpec/ConfigSpecCollection nested under it (however deep), and one "Edit" row drilling into a subscreen in its parent's UI.
Constructors¶
ConfigGroup¶
constructor(title: Component, id: String = title.string.toSnakeCase())
Properties¶
children¶
val children: List<ConfigNode>
Nested ConfigNodes declared inside this group.
id¶
Stable identifier - this node's path segment when nested under a ConfigGroup.
title¶
open override val title: Component
Display title shown for this node's row in its parent's screen.