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
Nostalgia Squared Remake Nostalgia Squared Remake Fellas Exploration Fellas Exploration Create Aeronautics Survival Create Aeronautics Survival Morphica RP Morphica RP Best Survival Modpack For Latest Version Best Survival Modpack For Latest Version Lumin Origins Lumin Origins SVA Dragonfall SVA Dragonfall Factory Age Factory Age The Genesis - Origins The Genesis - Origins AllTheAvaritia ATA1 AllTheAvaritia ATA1 The Goons Lagoon The Goons Lagoon medieval smp S4 medieval smp S4 Create Continents Create Continents HearthBound Homestead HearthBound Homestead Concatenation Lumineth Concatenation Lumineth Goon Crew Collection Goon Crew Collection Enigmatica 10 - Bosses Unleashed Enigmatica 10 - Bosses Unleashed  Technology Evolution  TE Technology Evolution TE many structures and more stuff for all to enjoy many structures and more stuff for all to enjoy CleanCraft by ACUL [Neoforged] CleanCraft by ACUL [Neoforged] Infinity Questing Systems Infinity Questing Systems Eevee Isles Eevee Isles TSpack TSpack RailCore official community modpack RailCore official community modpack Age of Scales & Bones Age of Scales & Bones Sweet Dre Friends Sweet Dre Friends GearboundSMP S2 - Create Multiplayer GearboundSMP S2 - Create Multiplayer QoL Skyblock QoL Skyblock MagicaIndustries MagicaIndustries TerraFirmaCivilization Season 2 TerraFirmaCivilization Season 2 ThaSMP ThaSMP Chiapas Middle-Earth Chiapas Middle-Earth Niglo Survival Sky Niglo Survival Sky DivineRPG Plus DivineRPG Plus Yucataland Yucataland Honkerton Honkerton Projet N-Tech Projet N-Tech MysteriaSMP MysteriaSMP Cobbled Kingdom Mons Cobbled Kingdom Mons N-Tech RockBlock 4 N-Tech RockBlock 4 New Horizons 3 [Horror] New Horizons 3 [Horror] Gears and Legends Gears and Legends Frozen Horrors Frozen Horrors ROLO Edition ROLO Edition Glowstone Galaxy Create Edition Glowstone Galaxy Create Edition MoveEarth MoveEarth Mana and Metal 2.0 Mana and Metal 2.0 miz's horror pack miz's horror pack Measured Infinity Measured Infinity All The Heros All The Heros VACraft VACraft Alex's Pack 1.21.1 Alex's Pack 1.21.1 SO7 Modpack SO7 Modpack Guns, Vehicles and Food Guns, Vehicles and Food Fast and Better Vanilla Fast and Better Vanilla EasyColonies2 EasyColonies2 Havoc & Haven - Blossoms and Banners Havoc & Haven - Blossoms and Banners Armoured Colonists Armoured Colonists TechFactory [TECH] TechFactory [TECH] Random House - Interestelar Random House - Interestelar Aeternis Aeternis Size Matters Size Matters Eclipse Client Eclipse Client Cobblemon Perfected Cobblemon Perfected Lucky Pixelados Lucky Pixelados Create Trains Fabric Create Trains Fabric Needed Essentials Needed Essentials Goon Crew Collection VR Goon Crew Collection VR MewmiCraft MewmiCraft Outerworlds Outerworlds Dawn and Dusk [BETA] Dawn and Dusk [BETA] Become  A Hero V2 Become A Hero V2 Revitrix Revitrix World of Drakora Medieval edition World of Drakora Medieval edition Nightmare-Pack Sky Unlockt Nightmare-Pack Sky Unlockt Scape and Run PerplexApple Scape and Run PerplexApple All You Need 2 - AYN 2 All You Need 2 - AYN 2 BecksCraft BecksCraft Aeronautic Colonies Aeronautic Colonies Cozy Visuals Cozy Visuals Voloron 4 Voloron 4 Triforce's Cobblemon Academy Triforce's Cobblemon Academy Cobblemon aBunchaMods Cobblemon aBunchaMods More Magika! More Magika! Toky Craft Toky Craft Classic Evolved Zero Classic Evolved Zero ImAcidicSMP Modpack ImAcidicSMP Modpack Bucketsink Bucketsink AstroGregExsilium AstroGregExsilium Build Secure Protect Build Secure Protect Forge & Frontier [FORGE] Forge & Frontier [FORGE] Guns, Dragons, and Death! Guns, Dragons, and Death! Christmas Modpack (yeah) Christmas Modpack (yeah) Spells Gears n' Bells RP Spells Gears n' Bells RP VtubersPlayCobblemon VtubersPlayCobblemon Dungeon Crawlers SMP Dungeon Crawlers SMP Kainel Kainel  Gigantocraft™ : The Age of Arkania Gigantocraft™ : The Age of Arkania TCC - Skyzone TCC - Skyzone LiteHearted LiteHearted

External Resources