promotional banner

QoLib

Prerequisites for mods created by Quantum8060

QoLib

Shared utilities for Quantum8060's Fabric mods.

Client Config API

The first QoLib API is a client-only JSON config store. Its public types do not expose Minecraft classes, so consumer mods may use either Mojang or Yarn mappings.

private static final ConfigValue<Boolean> ENABLED = ConfigValue.booleanValue("enabled", false);
private static final ClientConfig CONFIG = ClientConfig.builder("viewer-mod")
    .add(ENABLED)
    .build();

// In ClientModInitializer#onInitializeClient:
CONFIG.load();

ENABLED.set(true);
CONFIG.save();

Supported value types are boolean, ranged integer, ranged decimal, string, and enum. Config files are stored at config/<mod-id>.json. Invalid or missing fields use their declared defaults. Saving uses a temporary file and atomic replacement when available.

The API keeps persistence separate from the settings screen, so values can also be changed through key bindings or other client logic.

Settings screen

Use config.screen("Title") to define categories, toggles, sliders, numeric fields, and action buttons. build(parent) returns a Screen for a Mod Menu config-screen factory. The screen stages changes until Save; Cancel leaves the config intact. The search box searches labels and descriptions across every category.

return CONFIG.screen("Viewer Mod")
    .category("general", "General", menu -> menu
        .toggle("Enabled", "Save received chunks", ENABLED)
        .integerSlider("Radius", "Chunks to capture", RADIUS, 1, 16)
        .integerField("Maximum files", "Archive limit", MAX_FILES))
    .category("tools", "Tools", menu -> menu
        .button("Clear cache", "Deletes the local cache", ViewerCache::clear))
    .build(parent);

The QoLib Team

profile avatar
  • 2
    Projects
  • 312
    Downloads

More from Quantum8060

  • PlayerRader project image

    PlayerRader

    This is a Fabric client mod that displays the positions of other players—received by the client via the Minecraft 1.21.11 Locator Bar as marker overlays in JourneyMap.

    • 171
    • August 11, 2026
  • PlayerRader project image

    PlayerRader

    This is a Fabric client mod that displays the positions of other players—received by the client via the Minecraft 1.21.11 Locator Bar as marker overlays in JourneyMap.

    • 171
    • August 11, 2026