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

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
RePalmon RePalmon Apex - Deprivation Apex - Deprivation Createch 2 Createch 2 The Broken Script Origines The Broken Script Origines Beyong Depth (Ru translate) Beyong Depth (Ru translate) PROJECT: Geometra PROJECT: Geometra HallowScream 4 HallowScream 4 Twisted Towns Twisted Towns TechBlock - SkyTech 3 TechBlock - SkyTech 3 StoneBlock Project Matter StoneBlock Project Matter CrownAotVideoPack CrownAotVideoPack VanillaEnhancedCraft VanillaEnhancedCraft Elarion Elarion Velox Resurrected Velox Resurrected Technical Dragonrider Technical Dragonrider Reminiscent Create Reminiscent Create Mystical Realms - A Modded Server Mystical Realms - A Modded Server Skybound Origins Skybound Origins StormForge Pack StormForge Pack Mana & Mechanisms Mana & Mechanisms Dracenia Dracenia AdvoTech ValkyrienSkies (abandoned) AdvoTech ValkyrienSkies (abandoned) Plastek 3 Plastek 3 HCT - Hexandcube's Client Tweaks HCT - Hexandcube's Client Tweaks horrifying weather horrifying weather Createmon: Cidade Mêcanica Createmon: Cidade Mêcanica Create: Workshop [UwU Edition][Expert] Create: Workshop [UwU Edition][Expert] PROJECT DREAD - Dark Waters PROJECT DREAD - Dark Waters Modern Apocalypse: Spore Edition Modern Apocalypse: Spore Edition Reclamation - Vessels Of Raven Reclamation - Vessels Of Raven Minecolonies - Order and Chaos Minecolonies - Order and Chaos Tardis Engineers 3 Tardis Engineers 3 PepeBright PepeBright CottageCore Creations CottageCore Creations Guns and Horror Guns and Horror ES CRAFT ES CRAFT Create: Flat Factories Create: Flat Factories HiveCraft HiveCraft Lucky Block Challenge (Pod Edition) Lucky Block Challenge (Pod Edition) Create Creative and Beyond Create Creative and Beyond We Create SMP We Create SMP Tech-Craft Tech-Craft Gearspack Gearspack Vault Hunters Lunar Edition Vault Hunters Lunar Edition Five Nights at Freddy's (FNAF) Ultimate Five Nights at Freddy's (FNAF) Ultimate SMP Aesthia SMP Aesthia Create: Cursed Create - Zombie Apocalypse Create: Cursed Create - Zombie Apocalypse God Of The Bosses God Of The Bosses Create: Aloft Create: Aloft Create: Guns and Artillery Create: Guns and Artillery From The Fog But EXTRA scary (Recommended for Strong PC's) From The Fog But EXTRA scary (Recommended for Strong PC's) Mystic Sky Mystic Sky Farwater: Create Basics Farwater: Create Basics Cobblemon Dimensions Cobblemon Dimensions Ultimate Heroes Ultimate Heroes The Ultimate PVP Modpack The Ultimate PVP Modpack Planes Trains and Cobblemon Planes Trains and Cobblemon Loyal Sky Loyal Sky Echoes of Volkrune - Rebirth of Order Echoes of Volkrune - Rebirth of Order Diddycraft: Toe Ticklers Diddycraft: Toe Ticklers Farmers Dynasty Farmers Dynasty CobbleCafe Oficial CobbleCafe Oficial Tensura: Myriad Rebirth Tensura: Myriad Rebirth Verity souls JE Verity souls JE SimpleSurvival SimpleSurvival RubberCraft RubberCraft A Bit o' Everything A Bit o' Everything The realistic jujutsu{jjk} The realistic jujutsu{jjk} Horror but Guns Horror but Guns Cavers Delight Cavers Delight AllTheMons - The Void AllTheMons - The Void Better Than Adventure-Forge Better Than Adventure-Forge Mechanical Horizons Aeronautics Mechanical Horizons Aeronautics Kestramon Kestramon Nukes And Power Nukes And Power FROM THE FOG - (INSPIRED) FROM THE FOG - (INSPIRED) Naturalist+ Naturalist+ Go Eevee v3 - Pixelmon/Create Go Eevee v3 - Pixelmon/Create Project Arc Light -  Dimensional Rift Project Arc Light - Dimensional Rift Better Fresh Start (BFS) Better Fresh Start (BFS) OmniCraft Evolved OmniCraft Evolved Fossils & Archaeology Unearthed Fossils & Archaeology Unearthed VisualCraft by Moizoref VisualCraft by Moizoref Cobblemon Sky Adventure Cobblemon Sky Adventure ReCraft S8 Project infinity 0.1 ReCraft S8 Project infinity 0.1 GATE Guns & Magic GATE Guns & Magic Clovercraft Ultimate Clovercraft Ultimate Create & Destroy Create & Destroy GR's RPG: medieval fantasy GR's RPG: medieval fantasy Trappincorpo SMP Pack Trappincorpo SMP Pack Bright Fantasy Adventure Bright Fantasy Adventure Parity: Thoughtfully Designed Parity: Thoughtfully Designed Pony Pony Panic Pony Pony Panic MacedCraft MacedCraft Doncicraft Doncicraft Shattered Skies [LC] Shattered Skies [LC] CastleQuest SMP CastleQuest SMP Voltz (Volts) Reimagined - Official Server Voltz (Volts) Reimagined - Official Server Createrington Cogs & Steam Createrington Cogs & Steam Arcane Empires & Ancient Evils Arcane Empires & Ancient Evils

External Resources