Overview
TheConfigSystem manages all configuration storage and retrieval in LiquidBounce. It provides a hierarchical system for organizing settings, supports JSON serialization, and handles config file management.
Package: net.ccbluex.liquidbounce.config
Object Declaration
Constants
Prefix for all configuration keys
Properties
Main configuration directory (.minecraft/LiquidBounce/)
User-created configs directory (.minecraft/LiquidBounce/configs/)
Backup configs directory (.minecraft/LiquidBounce/backups/)
List of all registered root configs
True if this is the first time LiquidBounce is launched
Core Methods
Config Registration
Creates and registers a root config.Example:
Registers an existing config instance.
Config Storage
Saves a config to its JSON file.Example:
Saves all registered configs.Called automatically on world change and disconnect.
Config Loading
Loads a config from its JSON file.Example:
Loads all registered configs.
Backup & Restore
Creates a ZIP backup of configs.Example:
Restores configs from a ZIP backup.Example:
Value Lookup
Finds a value by its key path.Example:
Finds a value group by its key path.
Returns sequence of all value keys with given prefix.
Returns sequence of all value group keys with given prefix.
Serialization
Serializes a value group to JSON.
Deserializes JSON into a value group.
Deserializes JSON into a value.
Usage Examples
Creating a Config
Saving and Loading
Creating Backups
Finding Values
Iterating Values
Config File Structure
Configs are stored as JSON files:Automatic Config Management
Configs are automatically managed:- On World Change - All configs saved
- On Disconnect - All configs saved
- On Client Shutdown - All configs saved
- On First Launch - Default configs created
Best Practices
- Register configs early - During initialization
- Use meaningful names - Config file names should be clear
- Group related settings - Use ValueGroups to organize
- Create backups before risky operations - Prevent data loss
- Handle load errors gracefully - Invalid configs shouldn’t crash
- Use normalized keys - Always use
liquidbounce.prefix
Migration Support
ConfigSystem supports config migration for renamed values:See Also
- Value Types - Available configuration value types
- AutoConfig - Automatic config system
- ValueGroup - Organizing values