YAML Config

Quick rating

YAML Config

No reviews yet

Config library with GUI based on the YAML format.

No Theme
No Genre
QoL & Tweaks
UI & Menu Tool
API/Library
Mod Loaders
NeoForge
Fabric
Minecraft
26.2

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Optional
Server Optional

About

Project Details

Type
Mod
License
Apache License 2.0
Latest Version
YAML Config Fabric 26.2 - 21.1.0
Authors
CurseForge
Modrinth

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

About

Description

Ko-fi Promotion Banner


YAML Config: A Minecraft Configuration Mod

Overview

YAML Config is a powerful Minecraft configuration mod that enables mod developers to create and manage configuration settings using the YAML file format. It offers a user-friendly GUI, extensive support for data types, and robust networking for client-server synchronization.

Features

  • YAML File Format: YAML Config utilizes the YAML file format, known for its readability and ease of use.

  • GUI Interface: A well-designed GUI allows players to easily navigate and edit their configuration settings.

  • Extensive Data Type Support: The mod supports a wide range of data types, including:

    • Primitive Types: boolean, int, float, double, String, ResourceLocation, Registry
    • Collections: List, Map
    • Date and Time: LocalDateTime
  • Server-Client Synchronization: Changes made to configurations on the server are automatically synchronized to clients, ensuring consistency across the gameplay experience.

  • Modpack Support: The mod is designed to work seamlessly with existing modpacks, offering a flexible and expandable configuration system.

  • Validation and Error Handling: The mod includes robust validation and error handling, ensuring that configurations meet the expected requirements.

Installation and Usage

Installation

  1. Download the mod: Download the latest version of YAML Config from the mod's official website, CurseForge, or Modrinth.
  2. Place the mod file: Move the downloaded JAR file into the "mods" folder within your Minecraft directory.
  3. Launch Minecraft: Start Minecraft and join a world.

Usage

  1. Open the Configs Screen: Press "F12" on your keyboard to open the Configs screen.

  2. Navigate to the Config: The Configs Screen displays a list of available configurations. Select the mod whose configuration you want to modify.

  3. Edit Config Entries: The Config Screen displays the available settings. Each entry includes:

    • Title: The name of the setting.
    • Input Field: A field for editing the value.
    • Reset Button: A button for resetting the value back to its default.
  4. Save Changes: Click the "Save Changes" button to save your modifications. The mod will automatically save the changes to the configuration file and synchronize them with other players on the server (if applicable).

Development

Creating Configurations

1. Define a Config Class:

  • Create a new Java class within your mod's codebase that represents your mod's configuration.
public class MyModConfig {

    public static IConfig config;

    public static IConfigEntry<Boolean> debug;

    public static void init() {
        ConfigBuilder builder = new ConfigBuilder(MyMod.MOD_ID, "mymod-config", ConfigExtension.YAML, ConfigType.CLIENT);
    }
}

2. Define Config Entries:

  • Use the ConfigBuilder class to define the settings for your configuration.
  • Choose the appropriate data type for each entry using the define* methods.
// Example of defining a boolean entry:
debug = builder.defineBoolean("debug", false); 

// Example of defining an integer entry with range:
intEntry = builder.defineInteger("intEntry", 10, 0, 100); // Min 0, Max 100

// Example of defining a string entry with pattern:
stringEntry = builder.defineString("stringEntry", "test", "test\\d+"); 

// Example of defining a registry entry:
registryEntry = builder.defineRegistry("registryEntry", Blocks.GRASS_BLOCK, BuiltInRegistries.BLOCK);

// Example of defining a list:
stringListEntry = builder.defineStringList("stringListEntry", List.of("test1", "test2", "test3"), 3, 10); // Min 3, Max 10

// Example of defining a map:
integerMapEntry = builder.defineIntegerMap("integerMapEntry", Map.of("test1", 1, "test2", 2, "test3", 3), 3, 10); // Min 3, Max 10

3. Build the Configuration:

  • Call the build() method on the ConfigBuilder to create your configuration.
  • Store the configuration in a static field for easy access within your mod's code.
public MyModConfig() {
    ConfigBuilder builder = new ConfigBuilder("mymod", "mymod-config", ConfigExtension.YAML, ConfigType.CLIENT);
    // ... define config entries 
    config = builder.build(); 
}

4. Access Config Values in Your Code:

  • Use the get() method to retrieve the current value of a config entry.
  • Use the set() method to modify the value of a config entry.
// Example:
boolean debugEnabled = MyModConfig.debug.get(); // Retrieve the current value of the "debug" setting

if (debugEnabled) {
    // Perform debug-related actions 
}

MyModConfig.intEntry.set(25); // Set the value of the "intEntry" to 25

Config Type

  • ConfigType.CLIENT: Client-side configurations are specific to the client who has installed the mod. They are not shared with other players on the server.
  • ConfigType.SERVER: Server-side configurations are specific to dedicated servers. They will not be used on single player worlds and are not synced to the players on the server.
  • ConfigType.COMMON: Common configurations are shared between both clients and the server. They can be edited on the server by editing the config file directly and restarting the server or by editing the values using the in-game GUI and saving the changes.

Using Custom Data Types

  • Use the IConfigEntryType interface to register custom data types with the YAML Config mod.
  • Implement a custom serializer for handling the serialization and deserialization of your custom data type.

Modpack Configuration

  • If you are creating a modpack, you can use YAML Config to define the configuration settings for your modpack.
  • Place the configuration file for your modpack in the "config" folder within your modpack's directory.

Examples

// Example: Basic client-side configuration

public class MyModConfig {

    public static IConfig config;

    public static IConfigEntry<Boolean> debug;
    public static IConfigEntry<Integer> testInt;

    public static void init() {
        ConfigBuilder builder = new ConfigBuilder("mymod", "mymod-config", ConfigExtension.YAML, ConfigType.CLIENT);

        debug = builder.defineBoolean("debug", false) // default false.
                .withComments("Whether debug mode is enabled for the mod.");

        testInt = builder.defineInteger("testInt", 10, 0, 100); // default 10, min 0 and max 100.

        config = builder.build();
    }
}

Bisect Hosting Promotion Banner

Ko-fi Promotion Banner


YAML Config: A Minecraft Configuration Mod

Overview

YAML Config is a powerful Minecraft configuration mod that enables mod developers to create and manage configuration settings using the YAML file format. It offers a user-friendly GUI, extensive support for data types, and robust networking for client-server synchronization.

Features

  • YAML File Format: YAML Config utilizes the YAML file format, known for its readability and ease of use.

  • GUI Interface: A well-designed GUI allows players to easily navigate and edit their configuration settings.

  • Extensive Data Type Support: The mod supports a wide range of data types, including:

    • Primitive Types: boolean, int, float, double, String, ResourceLocation, Registry
    • Collections: List, Map
    • Date and Time: LocalDateTime
    • Server-Client Synchronization: Changes made to configurations on the server are automatically synchronized to clients, ensuring consistency across the gameplay experience.

    • Modpack Support: The mod is designed to work seamlessly with existing modpacks, offering a flexible and expandable configuration system.

    • Validation and Error Handling: The mod includes robust validation and error handling, ensuring that configurations meet the expected requirements.

Installation and Usage

Installation

  1. Download the mod: Download the latest version of YAML Config from the mod's official website, CurseForge, or Modrinth.
  2. Place the mod file: Move the downloaded JAR file into the "mods" folder within your Minecraft directory.
  3. Launch Minecraft: Start Minecraft and join a world.

Usage

  1. Open the Configs Screen: Press "F12" on your keyboard to open the Configs screen.

  2. Navigate to the Config: The Configs Screen displays a list of available configurations. Select the mod whose configuration you want to modify.

  3. Edit Config Entries: The Config Screen displays the available settings. Each entry includes:

    • Title: The name of the setting.
    • Input Field: A field for editing the value.
    • Reset Button: A button for resetting the value back to its default.
  • Save Changes: Click the "Save Changes" button to save your modifications. The mod will automatically save the changes to the configuration file and synchronize them with other players on the server (if applicable).

Development

Creating Configurations

1. Define a Config Class:

  • Create a new Java class within your mod's codebase that represents your mod's configuration.
public class MyModConfig {

    public static IConfig config;

    public static IConfigEntry<Boolean> debug;

    public static void init() {
        ConfigBuilder builder = new ConfigBuilder(MyMod.MOD_ID, "mymod-config", ConfigExtension.YAML, ConfigType.CLIENT);
    }
}

2. Define Config Entries:

  • Use the ConfigBuilder class to define the settings for your configuration.
  • Choose the appropriate data type for each entry using the define* methods.
// Example of defining a boolean entry:
debug = builder.defineBoolean("debug", false); 

// Example of defining an integer entry with range:
intEntry = builder.defineInteger("intEntry", 10, 0, 100); // Min 0, Max 100

// Example of defining a string entry with pattern:
stringEntry = builder.defineString("stringEntry", "test", "test\\d+"); 

// Example of defining a registry entry:
registryEntry = builder.defineRegistry("registryEntry", Blocks.GRASS_BLOCK, BuiltInRegistries.BLOCK);

// Example of defining a list:
stringListEntry = builder.defineStringList("stringListEntry", List.of("test1", "test2", "test3"), 3, 10); // Min 3, Max 10

// Example of defining a map:
integerMapEntry = builder.defineIntegerMap("integerMapEntry", Map.of("test1", 1, "test2", 2, "test3", 3), 3, 10); // Min 3, Max 10

3. Build the Configuration:

  • Call the build() method on the ConfigBuilder to create your configuration.
  • Store the configuration in a static field for easy access within your mod's code.
public MyModConfig() {
    ConfigBuilder builder = new ConfigBuilder("mymod", "mymod-config", ConfigExtension.YAML, ConfigType.CLIENT);
    // ... define config entries 
    config = builder.build(); 
}

4. Access Config Values in Your Code:

  • Use the get() method to retrieve the current value of a config entry.
  • Use the set() method to modify the value of a config entry.
// Example:
boolean debugEnabled = MyModConfig.debug.get(); // Retrieve the current value of the "debug" setting

if (debugEnabled) {
    // Perform debug-related actions 
}

MyModConfig.intEntry.set(25); // Set the value of the "intEntry" to 25

Config Type

  • ConfigType.CLIENT: Client-side configurations are specific to the client who has installed the mod. They are not shared with other players on the server.
  • ConfigType.SERVER: Server-side configurations are specific to dedicated servers. They will not be used on single player worlds and are not synced to the players on the server.
  • ConfigType.COMMON: Common configurations are shared between both clients and the server. They can be edited on the server by editing the config file directly and restarting the server or by editing the values using the in-game GUI and saving the changes.

Using Custom Data Types

  • Use the IConfigEntryType interface to register custom data types with the YAML Config mod.
  • Implement a custom serializer for handling the serialization and deserialization of your custom data type.

Modpack Configuration

  • If you are creating a modpack, you can use YAML Config to define the configuration settings for your modpack.
  • Place the configuration file for your modpack in the "config" folder within your modpack's directory.

Examples

// Example: Basic client-side configuration

public class MyModConfig {

    public static IConfig config;

    public static IConfigEntry<Boolean> debug;
    public static IConfigEntry<Integer> testInt;

    public static void init() {
        ConfigBuilder builder = new ConfigBuilder("mymod", "mymod-config", ConfigExtension.YAML, ConfigType.CLIENT);

        debug = builder.defineBoolean("debug", false) // default false.
                .withComments("Whether debug mode is enabled for the mod.");

        testInt = builder.defineInteger("testInt", 10, 0, 100); // default 10, min 0 and max 100.

        config = builder.build();
    }
}

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~650,000
Total Downloads
CurseForge
~440,000
Modrinth
~210,000
Last Updated
CurseForge
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works