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

182,105,077

CurseForge ID

438332

Modrinth Downloads

31,332,106

Modrinth ID

LN9BxssP

Last Updated

Sep 13, 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> specialValuebuilder.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

Fabric Forge Neoforge Quilt

Game Versions

1.12 1.12.1 1.12.2 1.14 1.14.1 1.14.2 1.14.3 1.14.4 1.15 1.15.1 +40 more

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,297)

Show fewer
All the Mods 10 - ATM10 All the Mods 10 - ATM10 Zombie Invade 100 Days Zombie Invade 100 Days All the Mods 9 - ATM9 All the Mods 9 - ATM9 Prominence™ II: Hasturian Era Prominence™ II: Hasturian Era DawnCraft - Echoes of Legends DawnCraft - Echoes of Legends All the Mods 8 - ATM8 All the Mods 8 - ATM8 DeceasedCraft - Urban Zombie Apocalypse DeceasedCraft - Urban Zombie Apocalypse COBBLEVERSE - Pokemon Adventure [Cobblemon] COBBLEVERSE - Pokemon Adventure [Cobblemon] Vault Hunters Third Edition Vault Hunters Third Edition Crazy Craft Updated Crazy Craft Updated All in One [Modded One Block] All in One [Modded One Block] Valhelsia 3 Valhelsia 3 All the Mods 10: To the Sky   ATM10SKY All the Mods 10: To the Sky ATM10SKY Beyond Depth Beyond Depth All the Mods 9 - To the Sky - atm9sky All the Mods 9 - To the Sky - atm9sky FTB StoneBlock 4 FTB StoneBlock 4 Valhelsia 2 Valhelsia 2 Craftoria Craftoria Craft to Exile 2 (VR Support) Craft to Exile 2 (VR Support) BigChadGuys Plus (w/ Cobblemon!) BigChadGuys Plus (w/ Cobblemon!) All the Mods 7 - To the Sky - atm7sky All the Mods 7 - To the Sky - atm7sky Lucky World Invasion Lucky World Invasion Better Adventures+ Better Adventures+ Slimes Adventure Slimes Adventure All the Mons - ATMons All the Mons - ATMons Prominence™ II: Hasturian Era Prominence™ II: Hasturian Era Kimetsu no Yaiba (Demon-Slayer) ModPack Kimetsu no Yaiba (Demon-Slayer) ModPack Fantasy MC Fabric Fantasy MC Fabric Valhelsia 6 Valhelsia 6 Integrated MC Integrated MC MC Eternal 2 MC Eternal 2 Solo Leveling - Reawakening Solo Leveling - Reawakening MineColonies Official MineColonies Official Isle of Berk (Claws of Berk) Isle of Berk (Claws of Berk) TerraFirmaGreg-Modern TerraFirmaGreg-Modern Enigmatica 6 - E6 - 1.16.5 Enigmatica 6 - E6 - 1.16.5 SkyFactory 5 SkyFactory 5 Cobblemon Delta Cobblemon Delta Create: Perfect World Create: Perfect World FTB OceanBlock 2 FTB OceanBlock 2 Play as Dragon [Abandoned] Play as Dragon [Abandoned] Society: Sunlit Valley Society: Sunlit Valley Endless Horror - The ULTIMATE Horror Experience Endless Horror - The ULTIMATE Horror Experience Aged Aged Pokemon Elysium Pokemon Elysium MineColonies: Dimensional Adventure MineColonies: Dimensional Adventure M-Tech M-Tech All the Mods 9 - No Frills All the Mods 9 - No Frills All the Mods 6 - To the Sky - ATM6sky - Skyblock All the Mods 6 - To the Sky - ATM6sky - Skyblock Chocolate Edition Minecraft Chocolate Edition Minecraft Prehistoric World - Dinosaurs, Adventure & Quests | NEW PREHISTORY UPDATE! Prehistoric World - Dinosaurs, Adventure & Quests | NEW PREHISTORY UPDATE! Project Architect 2 Project Architect 2 Landscapes Reimagined Genesis Landscapes Reimagined Genesis New Game - An Improved Experience | 1.21 UPDATE! New Game - An Improved Experience | 1.21 UPDATE! Medieval MC [FORGE] MMC4 Medieval MC [FORGE] MMC4 Star Technology Star Technology One Block Horror One Block Horror Abyssal Ascent Abyssal Ascent Chosen's Modded Adventure Chosen's Modded Adventure Craft to Exile [Dissonance] Craft to Exile [Dissonance] Pokehaan Craft 2 Pokehaan Craft 2 Create+ [Old] Create+ [Old] Biohazard: Project Genesis - The Ultimate Apocalypse Biohazard: Project Genesis - The Ultimate Apocalypse Cisco's Fantasy Medieval RPG [Dragonfyre] Cisco's Fantasy Medieval RPG [Dragonfyre] Reclamation - Reclaim the World! Reclamation - Reclaim the World! BigChadGuys and the Holy Grail BigChadGuys and the Holy Grail VerityCraft - A Realistic Horror Experience VerityCraft - A Realistic Horror Experience Lapito's Galacticraft Lapito's Galacticraft All of Fabric 6 - AOF6 All of Fabric 6 - AOF6 UniversIO UniversIO Exosphere 1 Exosphere 1 Seaopolis: Submerged Seaopolis: Submerged SkyFactory One SkyFactory One All of Fabric 7 - AOF7 All of Fabric 7 - AOF7 All the Mods 11 - ATM11 All the Mods 11 - ATM11 Astroblock Astroblock Ragnamod VI Ragnamod VI Cottage Witch Cottage Witch Beyond Ascension Beyond Ascension Infernal Origins Infernal Origins Ascendra Ascendra Valhelsia 5 Valhelsia 5 Industrial Village Industrial Village Cave Factory Cave Factory FTB Skies 2 FTB Skies 2 Age of Fate Age of Fate Dysfunctional's Tech, Bombs, Guns, and War Dysfunctional's Tech, Bombs, Guns, and War Essentials Mods [FORGE] - 1.21 RELEASE! Essentials Mods [FORGE] - 1.21 RELEASE! Cute Craft Cute Craft Raspberry Flavoured Raspberry Flavoured Cobblemon Academy 2.0 Cobblemon Academy 2.0 New Simple Mods - Easy to Understand | 1.21 UPDATE! New Simple Mods - Easy to Understand | 1.21 UPDATE! Stacia 2 Expert Stacia 2 Expert Pokemania Cobblemon Pokemania Cobblemon Monumental Experience Monumental Experience StaTech Industry StaTech Industry Mystical Block Mystical Block More Animals [FORGE] - 1.21 UPDATE! More Animals [FORGE] - 1.21 UPDATE! Techopolis 3 Techopolis 3 TownCraft TownCraft

External Resources