MonitoringMinecraft MonitoringMinecraft

a0fefd's ConfigLib

Мод Fabric

A configuration library for mods. Adds an interface to add config options and a gui to interface with them.

3 скачивания 0 подписчиков
Оцените первым

ConfigLib

A lightweight config library for Fabric mods. Describe your options as plain Java objects and get a working in-game config screen, a / command to open it, and JSON persistence, all without hand-rolling a GUI.

Why

Most mods end up writing the same boilerplate: a data class for settings, a screen to edit them, and load/save logic to keep a JSON file in sync. ConfigLib handles all three in one small dependency, so you can focus on the options themselves instead of the plumbing around them.

Features

  • In-game config screen: tabbed by category, with sub-category headings to group related options within a tab.
  • Five option types: BOOL, NUM (int and float unified), STR, ENUM (any Java enum), and LIST (comma-separated, mixed types).
  • Auto-registered command: / opens the screen, no extra setup needed.
  • JSON persistence: options round-trip to /.json. A corrupted or outdated file falls back to defaults instead of crashing the game.

How to install

Add these to each section of file build.gradle

repositories {
	mavenCentral()
	maven { url = "https://raw.githubusercontent.com/a0fefd/ConfigLib/mvn-repo/" }
}
dependencies {
	implementation "com.a0fefd:configlib:<version>"
}

Replace <version> with your target version.

Usage

Config config = new Config("mymod", null);

config.builder.add(new ConfigOption<>(
        "example_toggle",
        "General",
        true,
        Boolean.class,
        ConfigOptionType.BOOL
));

config.load();
ConfigCommand.register(config);

That is enough to get a working /mymod command opening a config screen with one toggle in it. Add more ConfigOptions for more settings, and use the category and subCategory fields to organize a larger config into tabs and sections.

Requirements

  • Minecraft 26.1.2
  • Fabric Loader 0.19.3 or newer
  • Fabric API
  • Java 25 or newer
Смотри также

Похожие подборки моды — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

SkyBars
SkyBars Java + BE
2133 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
BULLCRAFT
BULLCRAFT Java + BE
158 онлайн
26.2 версия
Анархия! PvP | Работают поршни и вагонетки
Minestory
22 онлайн
1.21 — 26.2 версия
Выживание • Экономика • Кланы • Приваты • Ивенты • PVP • Работа
ReallyWorld КОПИЯ ВСЕМ АДМИНКА
54 онлайн
1.16.5 — 1.21.1 версия
ПвП, Гриферство, бесплатный донат Dragon, AIR DROP
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.21.4. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат