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
MI:Foundation MI:Foundation CREATE and COLONY - Better features with Create and MineColonies CREATE and COLONY - Better features with Create and MineColonies Go Create Go Create TechAcademy TechAcademy Medieval Horizons (Distant Horizons) Medieval Horizons (Distant Horizons) CrazyTown Season 3 CrazyTown Season 3 Ben 10: Galactic Adventures Ben 10: Galactic Adventures Winter Regrowth Winter Regrowth Elixir Elixir WinterCraft-Eternal Winter! WinterCraft-Eternal Winter! Prison Escape - Beginnings Prison Escape - Beginnings EMC SubTerra Tech EMC SubTerra Tech Arcane Colony: The Tinker’s Age Arcane Colony: The Tinker’s Age Dwellers Dwellers City Life: Lumina City City Life: Lumina City Back to Back Back to Back Monumental Experience - In the Sky Monumental Experience - In the Sky The Fallen World - Prehistoric Corruption The Fallen World - Prehistoric Corruption Project SkyQ 2 Project SkyQ 2 More Realistic [FABRIC] - 1.21 UPDATE! More Realistic [FABRIC] - 1.21 UPDATE! Space Craft (Galacticraft) Space Craft (Galacticraft) ElysiumCraft Rp ElysiumCraft Rp Ultra Hardcore Renewed - Do you dare to play it? | 1.21 UPDATE! Ultra Hardcore Renewed - Do you dare to play it? | 1.21 UPDATE! WANKIL CRAZY : LWI WANKIL CRAZY : LWI Create Block - Everything in the sky Create Block - Everything in the sky Compitum Magia Compitum Magia New Game 3 - Immersive RPG Adventures & RPG Quests New Game 3 - Immersive RPG Adventures & RPG Quests Create: Factory Builder Create: Factory Builder E.A.L Cozy Farming Pack E.A.L Cozy Farming Pack Remade And Remastered Remade And Remastered Chroma Endless Chroma Endless Elden Block Elden Block coEBLmon coEBLmon Furniture & Tech Furniture & Tech Cottage Craft Cottage Craft Blackstone Block Blackstone Block bleach soul society renewed bleach soul society renewed Create 2 Mekanism Create 2 Mekanism Calamity RPG III : Wounds of the World Calamity RPG III : Wounds of the World Rising Civilizations Rising Civilizations Aeropolis Aeropolis Crazy Crave 5 Crazy Crave 5 Create Sky Colonies - Valkyrian Skies X Create 6.0 Create Sky Colonies - Valkyrian Skies X Create 6.0 More Animals 2 - Exclusive Edition with Animals Quests! More Animals 2 - Exclusive Edition with Animals Quests! Avalon Cobblemon Oficial Avalon Cobblemon Oficial CrazyCraft Revived CrazyCraft Revived InsaneCraft "Modest" (LITE) InsaneCraft "Modest" (LITE) Mekanism: Automation Mekanism: Automation Moe's Spooky Jump-scare Simulator Moe's Spooky Jump-scare Simulator Cobblemon Factory (Now with all 1025 pokemon!) Cobblemon Factory (Now with all 1025 pokemon!) Uncharted Expeditions Uncharted Expeditions Ultra Distant Horizons Ultra Distant Horizons Fight or Blight Fight or Blight Ender's Journey - Beyond The End Ender's Journey - Beyond The End Tardis Engineers 2 Tardis Engineers 2 Magitech Fantasia Magitech Fantasia Danknum Opus Danknum Opus Jurassic World Reborn 2 LITE Jurassic World Reborn 2 LITE Terrafirma Engineering Terrafirma Engineering Journey to Dawn [RU] Journey to Dawn [RU] SkyColonies Ultimate Pack SkyColonies Ultimate Pack WT Endless Sky Adventures - Skyblock Edition WT Endless Sky Adventures - Skyblock Edition Lost_Civilization:Wilds Lost_Civilization:Wilds Avatar Mod 2: Out of the Iceberg Adventure! Avatar Mod 2: Out of the Iceberg Adventure! The Last War - Guns And Adventure The Last War - Guns And Adventure Magic Valley Magic Valley Crazier Crazy Craft Crazier Crazy Craft Ragnamod VII In The Sky Ragnamod VII In The Sky Majnr Skyblock Majnr Skyblock Sky of Grind Sky of Grind MineColonies - Cobblemon Conquest MineColonies - Cobblemon Conquest Lightly Balanced OneBlock Lightly Balanced OneBlock LunarFox LunarFox More Decorations 2 - Exclusive Edition | Decoration Mods! More Decorations 2 - Exclusive Edition | Decoration Mods! Security Point Security Point Exosphere 2 + Create (Aeronautics) Exosphere 2 + Create (Aeronautics) Fantasy MC Forge Fantasy MC Forge Sky Frogs Sky Frogs Create Expansion - Bigger Create+ | 6.0 UPDATE! Create Expansion - Bigger Create+ | 6.0 UPDATE! Isle of Berk Expanded Isle of Berk Expanded Multiblock Madness 2 Multiblock Madness 2 BM: Exosphere Community Edition BM: Exosphere Community Edition Primal Apocalypse - Unusual Survival with Dinosaurs, Guns and Quests | Prehistoric Apocalypse Primal Apocalypse - Unusual Survival with Dinosaurs, Guns and Quests | Prehistoric Apocalypse Project Isothermal Expert Project Isothermal Expert RealCraft RealCraft Shadow Awakening Shadow Awakening Cosmic Frontiers Cosmic Frontiers Shiner's Black Clover Shiner's Black Clover Cobblemon Optimised Cobblemon Optimised Create Combined Create Combined Epic Castle Siege Epic Castle Siege The Suspect's Journey The Suspect's Journey BM - Exosphere 2 Lite BM - Exosphere 2 Lite White Shrimp's Great Adventure White Shrimp's Great Adventure project-1193210 project-1193210 Horror OneBlock Horror OneBlock World of Minecraft Normal World of Minecraft Normal Mechanical Mastery Plus Mechanical Mastery Plus BM: Exosphere Lite BM: Exosphere Lite [CTM] Let's Cobble these Mons - a Cobblemon modpack [CTM] Let's Cobble these Mons - a Cobblemon modpack

External Resources