VanillaConfig Mod (1.21.10, 1.20.1) – Library for TreSet’s Mods
VanillaConfig Mod (1.21.10, 1.20.1) is a lightweight configuration library for Minecraft mods. It provides a simple API to declare, load, save, and migrate configuration values, and to expose them through an in-game configuration screen with accessibility support.
![]()
Features:
Setup
- Add VanillaConfig as a dependency in your mod build configuration (Gradle or similar).
- Create a central configuration class and register it during your mod initialization.
- Use the provided API to define configuration values and categories instead of manually reading or writing files.
Defining Configuration
Configuration is defined via a config builder. You describe:
- Identifier of the config file (usually your mod id).
- Categories to group related options.
- Entries with name, type, default value, optional range, and description.
After building, VanillaConfig loads values from disk (if present) or uses defaults and then keeps them synchronized with the config file.
Supported Types
VanillaConfig supports common Java and Minecraft types, for example:
- Primitives: boolean, int, long, double, float.
- Strings: single line or multi-line text.
- Collections: lists of supported value types.
- Enums: any Java enum.
- Minecraft types such as identifiers or registry-backed values, where supported by the library version.
Each type has a matching builder method, so the runtime can validate and render it correctly.
Versioning and Migration
- Each configuration file has a version (an integer or similar simple value stored in the file).
- When you change or remove options, you should increment the version and define a migration step.
- Migration code receives the old data and is responsible for:
- Renaming keys.
- Providing default values for new options.
- Transforming existing values to a new format.
If the file version is lower than the current version, all migrations are run in order until the config matches the latest structure.
Callbacks
VanillaConfig provides hooks you can register to react to configuration changes:
- Load callbacks – called after configuration is loaded.
- Save callbacks – called before or after configuration is saved.
- Change callbacks – called when a specific option is modified.
Use these callbacks to update cached values, refresh in-game state, or trigger behavior that depends on configuration.
Config Screen Integration
VanillaConfig can generate an in-game configuration screen that maps directly to your config structure:
- Each category becomes a section of the UI, with its own group of options.
- Each entry is rendered using an appropriate control, such as a checkbox, slider, text field, dropdown, or list editor.
- The screen respects the current values and writes changes back to disk when the user confirms.
You can register this screen with the mod menu or with your own opening logic.
Accessibility
The generated configuration screen follows accessibility-friendly patterns:
- Consistent navigation using keyboard and controller.
- Clear labels for all entries, usually derived from translation keys.
- Descriptive tooltips that explain each option.
- Use of standard widgets so players can rely on familiar behavior and input methods.
Recommended Usage Guidelines
- Keep option names short and clear.
- Always provide a default value and, when applicable, valid ranges.
- Use categories to separate unrelated features, so your config screen stays easy to navigate.
- When changing existing options, define version and migration rules to keep player configs compatible.
- Use callbacks to keep your mod behavior in sync with configuration without requiring a restart when possible.
Requires:
How to install:
Click the following link to view details: How to Install Mods for Minecraft Java Edition on PC: A Beginner Guide
VanillaConfig Mod (1.21.10, 1.20.1) Download Links
Other Versions:
For Minecraft 1.18.2
Fabric version: Download from Server 1
For Minecraft 1.19
Fabric version: Download from Server 1
For Minecraft 1.19.3, 1.19.2
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.19.4
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.20.1, 1.20
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.20.2
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.20.4
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.20.6
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.21.1, 1.21
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.21.3
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.21.4
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.21.5
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.21.8, 1.21.7, 1.21.6
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.21.10, 1.21.9
Fabric version: Download from Server 1 – Download from Server 2
0
7 days ago