SSCL Wiki

Config Setup

After creating a config, you can create categories and save the config.

category()

Creates or gets a category.

ConfigCategory camera = config.category("camera");

The category name is used as the TOML section, and also shown in Mod Menu.

[camera]

modId()

Gets the mod ID that owns the config.

String modId = config.modId();

side()

Gets the side of the config.

ConfigSide side = config.side();

categories()

Gets all categories in the config.

Collection<ConfigCategory> categories = config.categories();

save()

Saves the current values to the TOML file.

config.save();

SSCL does not save the file every time a value changes.

This means you can change multiple values and save once at the end.

Multiple Configs

A mod can create multiple independent config files.

public static final Config CLIENT_CONFIG = SSCL.create(
		MyMod.MOD_ID,
		"MyMod/client.toml",
		ConfigSide.CLIENT
);

public static final Config SERVER_CONFIG = SSCL.create(
		MyMod.MOD_ID,
		"MyMod/server.toml",
		ConfigSide.SERVER
);

Each Config has its own categories and values, and each one is saved to its own TOML file.

config/
└── MyMod/
	├── client.toml
	└── server.toml

When a mod has multiple configs, SSCL displays them as separate tabs in Mod Menu.