HomeJavaModsYAML Config
YAML Config

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

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:

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:

// 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:

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:

// 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

Using Custom Data Types

Modpack Configuration

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();
    }
}
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

YAML Config is a free Minecraft Java mod. Compatible with Minecraft 1.21.11, 1.21, 1.21.1, 1.21.9 and newer. Downloaded 461,192 times (via CurseForge). Download it and open it directly in the game.

Explore more