Wunderlib Wiki › Guides › Create a Custom Config File with UI Integration
Create a Custom Config File with UI Integration
Setting Up Your Config Class
WunderLib's typesafe config system lets you define configuration options that automatically generate a ModMenu-compatible UI screen. Start by creating a config class that extends WunderLib's config framework and annotate your fields with the provided decorators to control how they appear in the UI.
Generating the Config Screen
Once your config class is defined with proper annotations (such as sliders for numeric ranges, toggles for booleans, or text fields for strings), WunderLib automatically converts these into a user-friendly screen. Players can open this screen through ModMenu without editing JSON files manually.
Best Practices
- Use descriptive field names; they become UI labels
- Group related settings using category annotations if available
- Test your config screen in-game to ensure all field types display correctly
- Provide sensible default values so players have a working config immediately
This approach eliminates manual config file editing and keeps your mod's settings organized and accessible.