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,201,320

CurseForge ID

438332

Modrinth Downloads

33,926,244

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
Zombie World - Resurrecting Civilization Zombie World - Resurrecting Civilization Farming Overloaded Farming Overloaded Fantastic Frontier Fantastic Frontier Meccha Crafteleon Together ! Meccha Crafteleon Together ! Dragonworld Dragonworld SmashMC Cobblemon SmashMC Cobblemon The SuperHero Journey The SuperHero Journey Enchanted Genesis Enchanted Genesis CRIF 2 - Create an empire of Rats to fight "Ice&Fire" CRIF 2 - Create an empire of Rats to fight "Ice&Fire" Techno Magic - Trustworthy Techno Magic - Trustworthy NeoForge Foundry: StoneFactory Edition NeoForge Foundry: StoneFactory Edition All the furniture. All the furniture. FairyTALES FairyTALES Mystical Block Reloaded Mystical Block Reloaded Technological Ascent Technological Ascent Veritycraft By Kamerit Veritycraft By Kamerit Exploring the Universe - An Adventure between Planets (With Ad Astra & Quests) Exploring the Universe - An Adventure between Planets (With Ad Astra & Quests) Captive Survival Captive Survival New Age Science and Technology  Easy New Age Science and Technology Easy FWF LuckyBlocks FWF LuckyBlocks Impostor Syndrome Impostor Syndrome Chunklock Create Chunklock Create Sky Bees Reborn Sky Bees Reborn Kawaii Craftia Kawaii Craftia Misfits Prime Piece Misfits Prime Piece Andromeda Automation Andromeda Automation                                                                                                AMP - Mechanisms, Magic & Masonry AMP - Mechanisms, Magic & Masonry FTB Builders Paradise 2 FTB Builders Paradise 2 Project Spacee Project Spacee Evolution of the Ages 2 Evolution of the Ages 2 RTX ON [FABRIC] RTX ON [FABRIC] [CTC]Create: the Creation [CTC]Create: the Creation Endless End - A Multiverse Adventure Endless End - A Multiverse Adventure Create Overlord Aeronautics Update Create Overlord Aeronautics Update TotalFear [DREAD AND HORROR] wonderland.jar TotalFear [DREAD AND HORROR] wonderland.jar Factory in the Sky 4 Factory in the Sky 4 The Last One The Last One Stargate20 Stargate20 CivilizationPack CivilizationPack Ashes To Ashes Ashes To Ashes Unstable SMP Recreation Unstable SMP Recreation Creepy & Scary RPG Creepy & Scary RPG                                                                                                                             Alar Alar NANGMAN DESERT NANGMAN DESERT Melatonin Melatonin SMP | Somake Server SMP | Somake Server Grand Architecture Journey Grand Architecture Journey Spell Sword Spell Sword Sky Creations One Sky Creations One Adventures in Time - Dalek Wasteland Adventures in Time - Dalek Wasteland Shinobi-Craft Shinobi-Craft PMDS (The Unofficial SDMP Modpack) PMDS (The Unofficial SDMP Modpack) Aphmau's Roleplay Aphmau's Roleplay knight epic fight knight epic fight Fishing Block Fishing Block Create: Skies Above Create: Skies Above Crazy Craft 5.0 (Chaos Edition) Crazy Craft 5.0 (Chaos Edition) Crazy Craft Chaos Crazy Craft Chaos Medival, Magic & Tech Forge Medival, Magic & Tech Forge Create the Server Create the Server Beyond Fantasy - A Magic RPG Modpack Beyond Fantasy - A Magic RPG Modpack AtlanAbyss AtlanAbyss How to train your Dragon: The Third Part How to train your Dragon: The Third Part Create: Civilizations - C:C Create: Civilizations - C:C Thormen 1.21.1 - Mekanism -  Spaceships -  ICBMs -  Force Fields -  Nuclear Science  -  Voltz successor - Modpack server running Thormen 1.21.1 - Mekanism - Spaceships - ICBMs - Force Fields - Nuclear Science - Voltz successor - Modpack server running Apocalypse Begins [Zombie Apocalypse] Apocalypse Begins [Zombie Apocalypse] POKEFUN - The Ultimate Pokemon Adventure [Cobblemon} POKEFUN - The Ultimate Pokemon Adventure [Cobblemon} Factorio: Nuclear (OxMODPACK) Factorio: Nuclear (OxMODPACK) Cozy Cooking: Delicious Decor Cozy Cooking: Delicious Decor Cobblemon - Master Mon Cobblemon - Master Mon Stacia Stacia Cute Cottage Craft Cute Cottage Craft Cobblemon Kanto Map (abandoned) Cobblemon Kanto Map (abandoned) CrownlexVideoPack CrownlexVideoPack Faruk V Faruk V CRETANIA CRETANIA Create: Aeronautical Crafting Create: Aeronautical Crafting Just Forever Just Forever JJK Extra Cursed Fate JJK Extra Cursed Fate Create 2 Mekanism 2: Sky Edition Create 2 Mekanism 2: Sky Edition Alex's Caves: Adventures Plus Alex's Caves: Adventures Plus version 6.6.6     (Horror,Dweller,Scary,Terror) version 6.6.6 (Horror,Dweller,Scary,Terror) SeriousFirmaCraft (TFC + Create) SeriousFirmaCraft (TFC + Create) Mechanical Infinity Mechanical Infinity Extraordinary Energy : Modern Extraordinary Energy : Modern FuzeIII Season6 Modpack FuzeIII Season6 Modpack Steller: The Rise of the Kingdom Steller: The Rise of the Kingdom TJP - Endless Sky TJP - Endless Sky Crashed Crashed Beyond Crazycraft Beyond Crazycraft Devouring The World Devouring The World Ocean Depths Ocean Depths GregTech:New Beginnings GregTech:New Beginnings ChunkBound ChunkBound Aero's One Piece Event Aero's One Piece Event Cottage World Cottage World GregFactory Sky GregFactory Sky Create: Clockwork+ [Forge] Create: Clockwork+ [Forge] Gloomy  Rise Gloomy Rise Create Cobblemon-ised Create Cobblemon-ised

External Resources