Перейти к содержимому
Mineforgian

Configory

Configory is a lightweight configuration library for Minecraft mods. Define each value once - with its type, default, and validation rules - then read and write it with full type safety, dot-notation paths, and JSON-backed, per-mod config files.

Загрузки
212
Подписчики
0
Обновлён
9 июля 2026 г.
Лицензия
MIT

Опубликован 6 июля 2026 г.

Configory

Convention-based configuration for Minecraft mods.

Configory is a small Java configuration library that makes mod config feel simple at the call site without giving up type safety where your code needs it. Define a value once — with its type, default, and constraints — and use it safely everywhere.

public static final ConfigKey<Float> SPEED_MULTIPLIER =
        config.defineFloat("core.speed_multiplier", 1.0f)
                .range(0.1f, 10.0f)
                .describe("Global speed multiplier.")
                .register();

float speed = getConfig(SPEED_MULTIPLIER);
setConfig(SPEED_MULTIPLIER, 3.0f).save();

Need dynamic access for debug tooling or scripts? Reach for the same config by string path:

float speed = getConfig("core.speed_multiplier").asFloat();
setConfig("core.speed_multiplier", 3.0f).save();

Features

  • Typed config keys — read and write values with compile-time type safety.
  • Dot-notation paths — nest values inside a config's JSON file, or keep a simple mod to a single flat file.
  • Fluent validation — declare ranges and constraints once; invalid writes are rejected.
  • Generated command surface — expose your config through your mod's own in-game command, with zero Brigadier boilerplate.
  • JSON-backed files — human-readable config, with explicit saving so you control when it's written.
  • Per-mod isolation — each mod maps to its own config file, cleanly separated.
  • Lightweight bootstrap conventions — minimal setup to get going.

Notes

Configory is a loader-agnostic library mod (it depends only on Gson and targets Java 21). Compile against it as a normal dependency, but don't bundle it — ship it as a required dependency and let players install the Configory jar separately, so several mods can share one copy. A single jar loads on Fabric, Forge and NeoForge and it works across a very wide range of Minecraft versions.

Links


Icon: book_scroll_written by Malcolm Riley, CC BY 4.0, upscaled.

Ченджлог

0.2.0Релиз26.1.1, 26.1.2, 26.2 · 9 июля 2026 г.

0.2.0 (2026-07-08)

⚠ BREAKING CHANGES

  • A config's id now maps to its file location and dotted paths are pure JSON nesting (previously the first path segment selected the file). The on-disk layout is now config/.json (plus config//.json for extra configs), ConfigPath dropped file()/DEFAULT_FILE, and Config.save(String) / dirtyFiles() were removed in favor of save() / isDirty(). See #43.

Added

  • Add a type-agnostic display-string accessor to ConfigValue (#45) (8b29a41)
  • Add defineX shorthand for typed config definitions (#19) (4361b1c)
  • Add presence checks to ConfigValue for dynamic path reads (#23) (122a1cd)
  • Add strict-bound and finite-float numeric constraints (#44) (14b07e1)
  • Add trySet for validating dynamic writes without throwing (#24) (6c213c0)
  • Allow injecting ConfigStorage through the registry and bootstrap (#41) (744e80f)
  • Config id maps to the file location; paths are pure nesting (806721e)
  • Declare per-loader Minecraft compatibility and add Forge (#55) (0592ebd)
  • Generate a Brigadier command surface for config keys (#53) (b166660)
  • Map the config id to the file location and make paths pure nesting (#43) (d7bcf3c)
  • Publish to Modrinth Maven and document installation (#20) (fbb76f7)
  • Ship Fabric and NeoForge metadata so Configory installs as a library mod (#22) (1b1a24f)
  • Support enum-typed config keys (#46) (d08cee0)
  • Write defaults to disk on first bootstrap load (#48) (4eef472)

Fixed

  • Heal inverted min/max pairs when keys also carry cross-field validators (#52) (43bb2eb)
  • Prevent infinite recursion in mutual cross-field validators (#38) (3cd00fb)

Комментарии

Загружаем…