

ModernConfig

🚀 Introduction
ModernConfig is an advanced configuration library for Minecraft mods based on Fabric that radically simplifies settings management. Forget about complex console commands — now all parameters can be configured through an intuitive interface with smooth animations and modern design.
🎯 Key Features
📋 Configuration Types
- Toggles: Boolean values (on/off)
- Text Fields: String value input
- Sliders: Numeric parameters with customizable range and precision
- Lists: Dynamic string collections with add/remove functionality
- Color Selection: Color palette with HSV and HEX format support
- Dropdowns: Selection menus from multiple options
- Categories: Logical grouping of settings with nested structure
💻 For Developers
- Simple API: Convenient constructor for quick integration
- Change Handlers: Ability to track configuration changes
- Global Settings Screen: Single access point for all mod settings
- Hotkey: Open settings with right Shift (configurable)
- Optimization: Animations don't affect game performance
📷 Interface Examples
Main Menu
Main interface with animations and modern design
Configuration Options
Variety of input types: toggles, sliders, text fields, and others
Color Selection
HSV color selection tool with real-time preview
📥 Installation
For Players
- Install Fabric Loader and Fabric API
- Download ModernConfig
- Place the .jar file in the mods folder
- Launch Minecraft with Fabric profile
For Developers
Add ModernConfig to your build.gradle:
repositories {
maven {
name = 'QWERTZ-Repo'
url = 'https://repo.qwertz.app/'
}
}
dependencies {
modImplementation 'app.qwertz:modernconfig:1.0'
}
🎮 Usage
Opening Settings
- In-game: Press right Shift (key can be reassigned)
Navigation
- Main Screen: Displays all mods using ModernConfig
- Mod Selection: Opens settings for specific mod
- Back Button: Return to previous screen
💻 Developer Guide
Quick Start
Here's how easy it is to create a configuration:
public class YourMod implements ClientModInitializer {
@Override
public void onInitializeClient() {
ModernConfig config = ConfigBuilder.create("YourMod", "Your mod settings")
.toggle("enabled", "Enable mod", true)
.slider("power", "Power level", 50, 0, 100, 1)
.text("username", "Player name", "Steve")
.color("theme_color", "Theme color", 0x4A90E2)
.list("whitelist", "Player whitelist", "Player name")
.dropdown("difficulty", "Difficulty", Arrays.asList("Easy", "Normal", "Hard"), "Normal")
.build();
}
}
Using Categories
To organize multiple settings, use categories:
ModernConfig config = ConfigBuilder.create("AdvancedMod", "Advanced settings")
.category("general", "General settings", "Main configuration parameters", category -> category
.toggle("enabled", "Enable mod", true)
.slider("update_interval", "Update interval", 20, 1, 100, 1)
.text("server_url", "Server URL", "https://api.example.com")
)
.category("ui", "User interface", "Interface customization", category -> category
.color("primary_color", "Primary color", 0x4A90E2)
.color("secondary_color", "Secondary color", 0x2ECC71)
.dropdown("theme", "Theme", Arrays.asList("Dark", "Light", "Auto"), "Dark")
.slider("ui_scale", "UI scale", 1.0f, 0.5f, 2.0f, 0.1f)
)
.build();
Accessing Configuration Values
// Get configuration parameters by category path
ConfigOption<?> enabledOption = config.getOption("general", "enabled");
ConfigOption<?> updateOption = config.getOption("general", "update_interval");
// Get actual values
boolean isEnabled = (Boolean) enabledOption.getValue();
int updateInterval = (Integer) updateOption.getValue();
🛠️ Configuration Parameter Types
Toggle (Boolean)
.toggle("toggle_id", "Display name", default_value)
- Purpose: Enable/disable functions
- Examples: Feature flags, enable/disable options
Text Field (String)
.text("text_id", "Display name", "default_value")
.text("text_id", "Display name", "default_value", max_length)
- Purpose: Fields for text input
- Examples: Player names, server URLs, file paths, API keys
Slider (Numeric)
.slider("slider_id", "Display name", default_value, min_value, max_value, step)
- Purpose: Numeric input with range constraints
- Examples: Percentages, scales, intervals, counters, delays
Color Selection (Integer)
.color("color_option_id", "Display name", 0xRRGGBB)
- Purpose: Color selection using palette
- Examples: Theme colors, highlighting, interface customization
List (String Array)
.list("list_id", "Display name", "Element display name")
- Purpose: Lists of text entries
- Examples: Player whitelists, blocked items, keywords
Dropdown (String Selection)
.dropdown("dropdown_id", "Display name", Arrays.asList("Option1", "Option2"), "Default")
- Purpose: Select one option from a list
- Examples: Difficulty levels, themes, render modes, language selection
Categories (Organization)
.category("category_id", "Category name", "Description", category -> category
// Add parameters here
)
- Purpose: Organization of related parameters
- Examples: Logical grouping of related settings