VanillaConfig Mod — Guide
Technical Setup
For developers looking to utilize VanillaConfig in their own projects, the mod must be added as a dependency in the build configuration. This grants access to the VanillaConfig entry point and its builder-based API.
Documentation Legend
To navigate the technical documentation, please refer to the following legend: * [placeholder]: Parameters in square brackets are placeholders and must be replaced with actual code values (e.g., your mod's ID). * Type1/Type2: Methods with parameter types separated by a slash can accept either of the two types. * ?Type: Parameters prefixed with a question mark are optional and can be omitted.
Implementation
Developers typically initialize their configuration in the mod's main entry point using the following structure:
Config [myConfig] = VanillaConfig.create("[modid]");
Callbacks & Events
Callbacks are essential for mods that need to react immediately when a user changes a setting. VanillaConfig provides several hooks for this purpose:
- onLoad: Executed immediately after the configuration file is read from the disk. This is used to apply settings when the game starts.
- onSave: Executed whenever the user clicks 'Done' or 'Save' in the config screen. This is ideal for triggering resource reloads or world updates.
- onChanged: A granular callback that can be attached to a specific option. It fires only when that individual setting is modified, allowing for efficient, targeted updates.
Accessibility
VanillaConfig is built with accessibility in mind, ensuring that all players can navigate and modify their settings regardless of their input method or visual needs.
- Narrator Integration: Every button, slider, and text field is fully compatible with the Minecraft Narrator, providing audible feedback for option names and current values.
- Keyboard Navigation: Users can navigate the entire configuration screen using only the keyboard (Tab, Shift+Tab, Enter, and Arrow keys).
- High Contrast Support: The UI elements respect vanilla high-contrast settings and provide clear visual focus indicators.
Mobs, Items, and Blocks
As a technical library and API, VanillaConfig does not add any mobs, items, or blocks to the game. It is a backend utility that powers the settings menus of other mods.
If you are looking for specific gameplay features, please refer to the documentation for the mods that depend on VanillaConfig, such as: * Better Statistics Screen: Enhances the in-game statistics menu. * Better Advancements: Overhauls the advancements UI. * Simple Compass: Adds a customizable HUD compass. * RideHud: Displays advanced information about ridden entities.