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,217,777

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
Lost in Beta - The Forgotten Worlds Lost in Beta - The Forgotten Worlds Real Survival Project Real Survival Project PureMash Tech PureMash Tech One Piece but in a block game One Piece but in a block game  2b2m 2b2m [Updated] Farming [Updated] Farming Tensura Rebirth Tensura Rebirth Pebblecraft: Stratum Pebblecraft: Stratum The Eyes: Watch.Jar The Eyes: Watch.Jar Enchantments Enchantments A Jurassic Park A Jurassic Park Millenaire Magics Millenaire Magics SC Final Adventure - Machines SC Final Adventure - Machines Cobblemon Generations SMP Cobblemon Generations SMP Steam & Stratosphere Steam & Stratosphere Elysium [ASCENSION] Elysium [ASCENSION] Lord Of Family Lord Of Family Dwarfz 6 Dwarfz 6 A Crow's Adventure A Crow's Adventure Eternal MC Eternal MC PebbleTown PebbleTown The Joaozin's Gayzown's Reforged - Guelcraft The Joaozin's Gayzown's Reforged - Guelcraft Sabixonas Sabixonas Perfectly Immersive Optimized (Cheats Edition) Perfectly Immersive Optimized (Cheats Edition) EldenCraft: A Soulless RPG EldenCraft: A Soulless RPG NeoMinecolonies NeoMinecolonies BluePrint SMP BluePrint SMP Only Create It Only Create It Comfy SkyBlock 3 - Rebirth of the Void (RotV) Comfy SkyBlock 3 - Rebirth of the Void (RotV) Create - Means of Production Create - Means of Production HenryCraft HenryCraft Pino 4 Pino 4 Etar Experience Etar Experience Superhero and Ben10 SMP Superhero and Ben10 SMP A Christmas Nightmare A Christmas Nightmare The RawffleVerse Reforged The RawffleVerse Reforged Prime Piece Lite Prime Piece Lite G1gaCraft Reloaded V2 G1gaCraft Reloaded V2 Swiss Squared Swiss Squared Wendigos winter Wendigos winter Escape Room - Prison Escape Room - Prison PixelLife PixelLife DoomsDay Jurassic Survival DoomsDay Jurassic Survival Triberean's Ultimate Furniturecraft Triberean's Ultimate Furniturecraft KnopfSalats Create Live 7 Expansions KnopfSalats Create Live 7 Expansions Modern Combat - DSC Modern Combat - DSC A Colony Survival A Colony Survival ABC Create - Aeronautics ABC Create - Aeronautics Tobinator Stream-Pack Tobinator Stream-Pack Alamaos' Code: AgriTech Alamaos' Code: AgriTech Official Dynastie Community Modpack Official Dynastie Community Modpack BuildUp (NeoForge) BuildUp (NeoForge) Stellar Warfare Stellar Warfare All About Alchemy - Magic & Potions All About Alchemy - Magic & Potions Dinosaurs-Age Of Adventure Dinosaurs-Age Of Adventure KaijuuCraft KaijuuCraft CloudCraft ModPack CloudCraft ModPack RatProject RatProject Warcrimes Central Warcrimes Central StormCore StormCore amethyst pvp amethyst pvp Create: Astral Tinkerer Create: Astral Tinkerer Copper Country Furry Forge Copper Country Furry Forge Haydenmon Evolved Haydenmon Evolved Garden Mermaids Garden Mermaids Create - New Frontier Create - New Frontier Pixelmon Adventure and RPG Pixelmon Adventure and RPG Sable Wood - Japan Sable Wood - Japan La Bouloumbele La Bouloumbele MysticWorld MysticWorld Create Spellbound Create Spellbound The Creator Pack - Record Your Videos! The Creator Pack - Record Your Videos! Myths of Frost and Flame Myths of Frost and Flame Tensura Restricted Tensura Restricted Mystical goo Mystical goo IkeTech 2.0 IkeTech 2.0 The Quest The Quest CatzyCraft CatzyCraft The Colony Network S2 The Colony Network S2 Veloria SMP Veloria SMP The Oblivion verse The Oblivion verse Farming Bosses Farming Bosses Hypheria Hypheria Craftcore Craftcore Magitechnical Mysticism Magitechnical Mysticism Terraero Terraero Vanilla+ (w Cobblemon) Vanilla+ (w Cobblemon) Runethal Runethal Bosses & Spells Bosses & Spells Frizpa Studios: World War! Frizpa Studios: World War! Electricmon Electricmon Socky's Create Modpack Socky's Create Modpack TacApoth TacApoth Mine Mine No Mi Supremacia v2 Mine Mine No Mi Supremacia v2 Aiko's Dimensions Aiko's Dimensions Cobblemon Champions Cobblemon Champions Xomaps Decay Xomaps Decay Magitechnical Mysticism 2 Magitechnical Mysticism 2 Worlds Unbound Worlds Unbound Nomad Medival Nomad Medival

External Resources