-
Notifications
You must be signed in to change notification settings - Fork 0
Config Menu Integration
Use ElibConfigRegistry to put a button for your mod in Elib's Mod settings list. Registration only creates the shortcut; your mod must provide its own config Screen.
Register once during your mod's client initialization, after initializing any config data that the screen needs:
import dev.elpu7.elib.client.ElibConfigRegistry;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
ElibConfigRegistry.register(
"examplemod",
Component.literal("Example Mod"),
"1.0.0",
Identifier.fromNamespaceAndPath("examplemod", "icon.png"),
ExampleConfigScreen::new
);In this example, ExampleConfigScreen has a constructor accepting its parent Screen. When the user closes your screen, return to that parent. The icon should be a resource at assets/examplemod/icon.png. Pass null if you do not want an icon.
The version string is shown beside your mod's name. To omit it, use the overload without the version argument:
ElibConfigRegistry.register("examplemod", Component.literal("Example Mod"),
null, ExampleConfigScreen::new);Entries are keyed by mod ID. Registering the same ID again replaces its earlier entry. Elib does not automatically add a separate Mod Menu button for your mod; it lists your screen inside Elib's own menu.
For a complete working example, see PieChart's client initialization.