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,207,405

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
Super III Super III Crazy Cozy Adventure+ Crazy Cozy Adventure+ R.M. Apocalyptic Zombies R.M. Apocalyptic Zombies Crafting Craft 2 Crafting Craft 2 Atomized Atomized NeoCraft Gardens & Gadgetry NeoCraft Gardens & Gadgetry Dark Fantasy Reborn Dark Fantasy Reborn Flourish & Flutter: A Nature’s Journey Flourish & Flutter: A Nature’s Journey Savaru I - Survival Savaru I - Survival Better Yogbox Better Yogbox OPKoffee Infused OPKoffee Infused how_To_Train_Your_ dragon how_To_Train_Your_ dragon Baldi's Purge Pack Baldi's Purge Pack AllCreateMods AllCreateMods cloudmoon cloudmoon null's 2.0craft null's 2.0craft B i o m e c h B i o m e c h Sugar's Ultimate Changed Sugar's Ultimate Changed AOT : Attack on Titain AOT : Attack on Titain Claws and Skies (Isle of Berk) Claws and Skies (Isle of Berk) Genshin RP Origins Adventure Genshin RP Origins Adventure Zombotony - Zombie Apocalypse Zombotony - Zombie Apocalypse OUR-HEALTH OUR-HEALTH InfinityCraft Ultra InfinityCraft Ultra Fertility Fertility HeroesOfMultiverse HeroesOfMultiverse MI:Lost Favor MI:Lost Favor NYLE RP inspiré de PokéRayou & Cobblemon Academy 2.0 NYLE RP inspiré de PokéRayou & Cobblemon Academy 2.0 You Like Food? 2! You Like Food? 2! Valse's Chunk By Chunk Valse's Chunk By Chunk Create: Snow & Steel Create: Snow & Steel Minecolonies: Dragon Epoch Minecolonies: Dragon Epoch SCP Cursed SCP Cursed Create+ (Create with addons) Create+ (Create with addons) StickCraft Gamepad Edition StickCraft Gamepad Edition Xomembers Xomembers Dinosaur Survival Dinosaur Survival GregTech: Beyond CEu GregTech: Beyond CEu Create & Ars Nouveau Create & Ars Nouveau Naano Horizons - Utalyoa Edition Naano Horizons - Utalyoa Edition Homestead Horizons Homestead Horizons Schedule 2 Schedule 2 Cozy Cooking: Reborn Cozy Cooking: Reborn Space Race 5 Space Race 5 Endless New Horizons Endless New Horizons FleshPunk - A Biopunk Modpack FleshPunk - A Biopunk Modpack HugoSMP HugoSMP ButterSMP Official Pack ButterSMP Official Pack WUC Palladium WUC Palladium The Last Horror Experience [REHORRIFIED] The Last Horror Experience [REHORRIFIED] Dinosaurs and More  2 Dinosaurs and More 2 Immersive Portals - The Experience Immersive Portals - The Experience The CobbleMMO The CobbleMMO Chill Chill Createrington Rails 'n Sails Createrington Rails 'n Sails Shipping Lanes Survival Pack Shipping Lanes Survival Pack CookieCrafter CookieCrafter Backtanked Backtanked SHARKSQUAD - CURSED BOYS SHARKSQUAD - CURSED BOYS KOTD KOTD Wildera SMP Wildera SMP Create 0.6 Optimized Create 0.6 Optimized FreakCraft FreakCraft Sexluki Pack Sexluki Pack CursedWalking-Dread CursedWalking-Dread NarutoCraft NarutoCraft Broken Games Random Pack Broken Games Random Pack Epic Fights Castle Siege Epic Fights Castle Siege Super Intense Create Hardcore Super Intense Create Hardcore NightRein SMP NightRein SMP Benk's Medieval Minecraft Reloaded Benk's Medieval Minecraft Reloaded Quality of Life Primer Quality of Life Primer The Ancient Dawn LITE The Ancient Dawn LITE Create: Age of Trains Create: Age of Trains WARSMP - Tanks and All (Official) WARSMP - Tanks and All (Official) Modern Revolutions Skies Modern Revolutions Skies Ruthless Frontiers - Grim Harvest Ruthless Frontiers - Grim Harvest Project 4J (Console-Remix) Project 4J (Console-Remix) NeoLand NeoLand Infinity Pack 1 Infinity Pack 1 NoodlesSMP NoodlesSMP Extreme zombie survival (better zombie ai) Extreme zombie survival (better zombie ai) Create Light Create Light Ships Ahoy! Ships Ahoy! Pixel Craft Pixel Craft WHAT WE LOST - Zombie Apocalypse Modpack WHAT WE LOST - Zombie Apocalypse Modpack That Time I played Slime with my Friends That Time I played Slime with my Friends The Builder Land V1 The Builder Land V1 MAnA Laboratories MAnA Laboratories All Roads Lead to The Void All Roads Lead to The Void Pixie Land Pixie Land Camping Horror Pack Camping Horror Pack Pixelmon E2craft Pixelmon E2craft Vanilla+ Game Vanilla+ Game Better Adventures NextGen (shaders - ashen16x) Better Adventures NextGen (shaders - ashen16x) CrazyCraft Recreation CrazyCraft Recreation Puppy Girl Empire BCG/Cobblemon Puppy Girl Empire BCG/Cobblemon Solo Leveling: Extended Solo Leveling: Extended Dylan's Awesome Mod Pack Dylan's Awesome Mod Pack The Last Dawn III - Remastered The Last Dawn III - Remastered

External Resources