Modscraper Modscraper Minecraft
SuperMartijn642's Config Lib logo

SuperMartijn642's Config Lib

Mod

by SuperMartijn642

Config Lib makes dealing with config files just a bit easier.

Type

Mod

CurseForge Downloads

191,217,777

CurseForge ID

438332

Modrinth Downloads

33,931,933

Modrinth ID

LN9BxssP

Last Updated

Nov 7, 2026

Description


 SuperMartijn642's Config Lib

SuperMartijn642's Config Lib allows you to specify a config once and it then handles reloading values between world loads, syncing values with clients, and generating values for client- or server-only on its own.

 

Seperator

 

Creating a config:

 

A config is created using a ModConfigBuilder.

Simply create a new instance using #ModConfigBuilder().

 

   ModConfigBuilder builder = new ModConfigBuilder();

 

A value can be added to the config with ModConfigBuilder#define which takes a name and a default value.

For integer and double values a minimum and maximum value are also required.

Test code block;

 

ModConfigBuilder#define returns a Supplier which should be stored to retrieve the value from the config.

 

   Supplier<Boolean> booleanValue = builder.define( "booleanValue", true );

   Supplier<Integer> integerValue = builder.define( "integerValue", 5, 0, 10 );

   Supplier<Double> doubleValue = builder.define( "doubleValue", 0.5, 0, 1);

   Supplier<ExampleEnum> enumValue = builder.define( "enumValue", ExampleEnum.VALUE_1 );

 

A comment can be added to a value by calling ModConfigBuilder#comment(String) before defining the value.

 

   Supplier<Boolean> valueWithComment = builder.comment( "this is a comment for 'valueWithComment'" ).define( "valueWithComment ", true );

 

By default values are reloaded when world is loaded.

This can be changed to only reload a value when Minecraft launches by calling ModConfigBuilder#gameRestart() before defining the value.

 

   Supplier<Boolean> notReloadedValue = builder.comment( "this is value will not be reloaded" ).define( "notReloadedValue", true );

 

Values in COMMON or SERVER configs are synchronized with clients by default, to prevent this use ModConfigBuilder#dontSync().

 

   Supplier<Boolean> notSynchronizedValue = builder.comment( "this is value will not be synchronized" ).define( "notSynchronizedValue", true );

 

Values can also be put into categories.

ModConfigBuilder#push(String) pushes a category and ModConfigBuilder#pop() pops a category.

 

   builder.push( "special" );

   Supplier<Boolean> specialValue = builder.comment( "this value is in the 'special' category" ).define( "specialValue", true );

   builder.pop();

 

A comment can be added to the active category using ModConfigBuilder#categoryComment(String).

 

   builder.push( "client" ).categoryComment( "this, is a comment for the 'client' category" );

 

After defining all values ModConfigBuilder#build() must be called to finish the config.

 

   builder.build();

 

Now the values in your config will reloaded and synced automatically and the values can be retrieved using the stored Supplier instances.

This will work for all available versions, that includes Minecraft 1.12, 1.14, 1.15, and 1.16

 

Seperator

 

Example Mod:

 

For a concrete example of how to use Config Lib checkout the example mod.

 

Seperator

 

Discord

For future content, upcoming mods, and discussion, feel free to join the SuperMartijn642 discord server!

IG1us6p.png

 

Seperator

Compatibility

Mod Loaders

Client Fabric Server Quilt

Game Versions

26.3

Recommended Gear

Affiliate

Hardware and extras that pair well with this mod.

As an Amazon Associate I earn from qualifying purchases.

Similar Mods

Included in Modpacks (3,564)

Show fewer
Tensura - Rebirth Tensura - Rebirth Vix Vix Create: Perfect Cobblemon Create: Perfect Cobblemon THE Walking of the parasite 2 sunrising... THE Walking of the parasite 2 sunrising... Crafted Chaos Crafted Chaos DB Navigation & Trains DB Navigation & Trains Collectionist Collectionist Dank-Dreams Dank-Dreams Neufelden Neufelden Zoo and Adventures Forge Edition Zoo and Adventures Forge Edition Explorerflotte Create Explorerflotte Create Seasons of Survival Seasons of Survival Cobblemon - The Temporia Region Cobblemon - The Temporia Region Pokeheros 2 Pokeheros 2 The Ancient Hell The Ancient Hell Mangoescraft Mangoescraft Nuage Guns, Vehicles and mores Nuage Guns, Vehicles and mores ATGC Meltdown 2 - The Sky ATGC Meltdown 2 - The Sky Tensura Soul Tensura Soul Eternity SMP Eternity SMP LINDENFELD - Via Gastronomica LINDENFELD - Via Gastronomica Flora City Furniture Flora City Furniture Creatia 3 Creatia 3 Buddycraft - Oneblock Buddycraft - Oneblock Cobblemon - Mechanical Legends Cobblemon - Mechanical Legends ZonaCero Apocalypse Enhanced ZonaCero Apocalypse Enhanced IncredibleCraft-[FORGE]-1.20.1 IncredibleCraft-[FORGE]-1.20.1 Medieval Survival X - OLD Medieval Survival X - OLD Motors & Rotors Motors & Rotors The Builder's Paradise The Builder's Paradise The Milkyway SMP v1 beta (outdated) The Milkyway SMP v1 beta (outdated) Late Long Nights Late Long Nights Viriatus Viriatus Tuckabout A New Story - A Roundabout Jojo Experience Tuckabout A New Story - A Roundabout Jojo Experience Wandering Hollows Season 2 Wandering Hollows Season 2 Tinker's Tea Time Tinker's Tea Time Dragons & Trolls & Pokemon, Oh My! Dragons & Trolls & Pokemon, Oh My! Astral Titans Astral Titans Faga's Cobblemon & Create Faga's Cobblemon & Create The Powers that Be. The Powers that Be. Create Areo Naughts Create Areo Naughts New World Awakened New World Awakened V's Fantasy Modpack V's Fantasy Modpack Winter Leveling Winter Leveling GHyst Distant Horizons GHyst Distant Horizons Lively Craft Lively Craft SharkSquad Modpacks SharkSquad Modpacks A Potato modpack for Potato PC's A Potato modpack for Potato PC's Attack of the new B-Team Attack of the new B-Team Besacraft 1722 Besacraft 1722 Luminosity Luminosity CrazyCrafters 3.0 CrazyCrafters 3.0 Essential Mods Nuck Essential Mods Nuck Whimsy Brews Whimsy Brews WALY VANILLA WALY VANILLA MakeShift MakeShift Technia GTe Technia GTe Sneykor's Cobblemon online Sneykor's Cobblemon online Apotelesmatic Neoforge Apotelesmatic Neoforge Create Next to the Sky Create Next to the Sky Craft and Conquer Craft and Conquer IGGY's Warium Pack IGGY's Warium Pack Artemiscraft: Awakening of the Elements Artemiscraft: Awakening of the Elements I Heard it Too (UNOFFICAL) I Heard it Too (UNOFFICAL) Waymarked Waymarked Leo's Medieval Fantasy Leo's Medieval Fantasy Myths & Ruins (RPG) Myths & Ruins (RPG) Super Enhanced Visuals Super Enhanced Visuals RISAKU project RISAKU project Nukes R US Nukes R US Meow to Exile 2 Custom By Seraphina Meow to Exile 2 Custom By Seraphina Founding Realms - Millénaire + MineColonies Town Building Adventure Founding Realms - Millénaire + MineColonies Town Building Adventure Jimmu's Factory 2 Jimmu's Factory 2 Cannons and Cantrips - CaC Cannons and Cantrips - CaC Pixelmon: Extra Adventures 2 Pixelmon: Extra Adventures 2 Stone to Tech Stone to Tech Cobblemon Sink Cobblemon Sink Ice, Fire, & Gunpowder Ice, Fire, & Gunpowder Cobblemon Epsilon Tensura Super Reincarnated Tensura Super Reincarnated Leo's Military Factions Leo's Military Factions Client Optimized Client Optimized Slop Shooter 3000 Slop Shooter 3000 The More Horror The Better! The More Horror The Better! WolfCraft: Curse of the Moon WolfCraft: Curse of the Moon Convergence SMP Convergence SMP Ducky´s Create Ducky´s Create Sibo`s Vanilla Enhanced Sibo`s Vanilla Enhanced Peps SMP Season 4 Continents and Colonies Peps SMP Season 4 Continents and Colonies The Collective, The Aeronautical Edition The Collective, The Aeronautical Edition Warspire Warspire NinJutsu Origins NinJutsu Origins From the Stone Age to the Stars From the Stone Age to the Stars Prehistoric Nature Prehistoric Nature Stellar Foundry Stellar Foundry vibrant experience vibrant experience Realms Collide Eternal Realms Collide Eternal Greated Create Greated Create Gentle Giant Gentle Giant SRP Call of Death SRP Call of Death

External Resources