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,930,942

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
BUILDTECH 3 BUILDTECH 3 Hommage Hommage PojavCreate PojavCreate nuclear radiation 2 nuclear radiation 2 Farmy Skyblock Farmy Skyblock Dinosaurs Reborn Plus Dinosaurs Reborn Plus WT Endless Sky Adventures - SkyGrid Edition WT Endless Sky Adventures - SkyGrid Edition Cobblemon Enhanced (Pokemon) Cobblemon Enhanced (Pokemon) ISEKAICRAFT RPG ISEKAICRAFT RPG Project X (Palladium) Project X (Palladium) Girlypop Craft Girlypop Craft CobblemonCove - Cobblemon CobblemonCove - Cobblemon Cobble Souls  - With Optional Nuzlocke Mode Cobble Souls - With Optional Nuzlocke Mode Create: Gearworks Create: Gearworks Jujutsu Aurolith Jujutsu Aurolith narutoto Ultimate narutoto Ultimate FOXY COZY LITE FOXY COZY LITE HOICraftWW2 HOICraftWW2 Monumental Experience VI - Rise of the Dinosaurs Monumental Experience VI - Rise of the Dinosaurs Into the fog - scary mobs Into the fog - scary mobs solo leveling reawakening evolved Anime solo leveling reawakening evolved Anime Pokehaan Craft 2 - Lite Pokehaan Craft 2 - Lite GoonCrafts GoonCrafts Kamen Rider with the boys Kamen Rider with the boys Seas & Boats Seas & Boats WolfCraft Colonies - Season 5! WolfCraft Colonies - Season 5! Termincraft Termincraft TRIX SMP - QSMP Fan Server TRIX SMP - QSMP Fan Server superheroes tech superheroes tech Cozy Cozy Congregation - expert Gregtech pack Congregation - expert Gregtech pack All About Origins - Powers & Classes & Races All About Origins - Powers & Classes & Races Community in the Skies Community in the Skies Create Lost and Renaissance Create Lost and Renaissance TornadosX TornadosX Pokecade Cobblemon Pokecade Cobblemon Hikari Haven Cobblemon Hikari Haven Cobblemon Greg-E Greg-E TechCraftBrasil - Servidor Brasileiro - ONLINE TechCraftBrasil - Servidor Brasileiro - ONLINE Xomaps Pocket Xomaps Pocket FreakCraft - CrazyCraft Inspired FreakCraft - CrazyCraft Inspired OceanBlock - Skyblock Reinvented OceanBlock - Skyblock Reinvented #1 Cursed Fate - Jujutsu Kaisen Reforged #1 Cursed Fate - Jujutsu Kaisen Reforged Mystic's Monstrosity Lite Mystic's Monstrosity Lite C&K's Organized Crime C&K's Organized Crime Critters and monsters Critters and monsters Cobblemon Adventure - Pokemon modpack Cobblemon Adventure - Pokemon modpack ReNightmares Official Server Pack ReNightmares Official Server Pack Citadel I Citadel I Age of Fate: The Frozen Hope Age of Fate: The Frozen Hope TerraFirmaCraft:Leap The Top TerraFirmaCraft:Leap The Top  The end human civilization(100days) The end human civilization(100days) Your not alone (Horror) Your not alone (Horror) KREWCRAFT Reimagined KREWCRAFT Reimagined Kawaii Overload Forge Kawaii Overload Forge Outbreak Outbreak Lightweight Adventure RPG Survival Lightweight Adventure RPG Survival GregTech: Flatter Than Ever (GT:FTE) GregTech: Flatter Than Ever (GT:FTE) PokeSMP PokeSMP The Analog Archives The Analog Archives Gregified: Sky Edition Gregified: Sky Edition Aphmau's World Aphmau's World All Ultimate Selection All Ultimate Selection BeetleKnight's Beyond BeetleKnight's Beyond CozyCraft - Just Chill CozyCraft - Just Chill Refined Pack 2 Refined Pack 2 BottomlessThought's Realism BottomlessThought's Realism A Toca da Coruja A Toca da Coruja Create Clockwork Lite Create Clockwork Lite Cobblemon + Create - Pokemon meets Industrial Revolution! Cobblemon + Create - Pokemon meets Industrial Revolution! Colony:Exodus to the stars Colony:Exodus to the stars Captive 2 Captive 2 Huge Horror Pack [Horror] [Dweller] [Scary] Huge Horror Pack [Horror] [Dweller] [Scary] Xomaps Potato Sky Xomaps Potato Sky Over the Sky | Floating Islands, Mobs and Many Secrets! Over the Sky | Floating Islands, Mobs and Many Secrets! Shiner's Mushoku Tensei/Jobless Reincarnation Shiner's Mushoku Tensei/Jobless Reincarnation Adventure of Tech V Adventure of Tech V Fresh And Scary Fresh And Scary RockTown Tech World Sky Block RockTown Tech World Sky Block PvPvP Pack PvPvP Pack The Cyborg Runner The Cyborg Runner All Quiet on the Sink - AQS All Quiet on the Sink - AQS A Journey's End - RPG A Journey's End - RPG Society: Mystical Ocean Society: Mystical Ocean Create Evo Era Create Evo Era Create and colony - Create Aeronautics version! Create and colony - Create Aeronautics version! Nightmare Nether - A Multiverse Adventure Nightmare Nether - A Multiverse Adventure Tensura Infinite Tensura Infinite Cold Soul Cold Soul NinjaCraft - Official Server NinjaCraft - Official Server Arcanto Mythical III Arcanto Mythical III Lucky Legends Lucky Legends CheneTulipe Apocalipse Zombie Invasion CheneTulipe Apocalipse Zombie Invasion CordCraft Season 5 CordCraft Season 5 The last rider World The last rider World JujutsuCraft JujutsuCraft Arcadia Online (SAO) Arcadia Online (SAO) Project Arc Light - The Hanging Pavilion Project Arc Light - The Hanging Pavilion Mirabilis - Vanilla Plus Plus! Mirabilis - Vanilla Plus Plus! Permadeath+ Permadeath+

External Resources