-
Notifications
You must be signed in to change notification settings - Fork 0
Home
GMalvestiti edited this page Aug 17, 2026
·
5 revisions
Easy Config is a JSON5/TOML config library for Minecraft mods on Fabric and NeoForge. You just annotate a
plain Java class with @Config, hand it to a builder, and get back a ConfigHolder that handles
file path resolution, read/write operations, corrupt-file recovery, copies, validation, and
lifecycle events.
What Easy Config does:
- Configuration data layer: Easy Config handles config files, including paths, loading, saving, default values, corruption recovery, atomic writes, and JSON5/TOML formats.
- Safe state management: provides validated snapshots, copies, runtime updates, resets, and custom state cloning.
- Async and immutable configs: choose synchronous, asynchronous, or immutable holders depending on your threading and lifecycle needs.
- Restart guards: mark fields as restart-only so runtime updates cannot change values that require a game restart.
-
Custom update API:
updateandupdateAndSavereturn anUpdateResultwith success status and validation violations. - Fine-grained failure policies: independently control how read, write, and update failures are handled, from graceful fallback to strict exceptions.
- Lifecycle and event listeners: hook into config load, save, update, and reset events, or use config-level hooks for normalization and validation.
- Config groups: manage multiple config files through a single holder, with independent formats and failure recovery.
- Customizable entries: control file paths, field names, comments, ignored fields, and other persistence details.
Outside Easy Config's scope:
- Config screen: Easy Config is a data layer — it does not render UI by itself.
-
Client/server sync: use
UpdateResultoronUpdateto detect changes and dispatch packets.