Creating a Config
SSCL configs are created with SSCL.create().
public static final Config CONFIG = SSCL.create(
MyMod.MOD_ID,
"MyMod/config.toml",
ConfigSide.COMMON
);
The file path is relative to Minecraft's config/ directory.
For example:
"MyMod/config.toml"
creates:
config/MyMod/config.toml
Multiple Configs
A mod can create multiple independent config files.
Each call to SSCL.create() creates a separate Config.
public static final Config CLIENT_CONFIG = SSCL.create(
MyMod.MOD_ID,
"MyMod/client.toml",
ConfigSide.CLIENT
);
public static final Config COMMON_CONFIG = SSCL.create(
MyMod.MOD_ID,
"MyMod/common.toml",
ConfigSide.COMMON
);
public static final Config SERVER_CONFIG = SSCL.create(
MyMod.MOD_ID,
"MyMod/server.toml",
ConfigSide.SERVER
);
This creates:
config/
└── MyMod/
├── client.toml
├── common.toml
└── server.toml
Each config has its own categories and values.
public static final ConfigCategory GENERAL = CLIENT_CONFIG
.category("general");
public static final ConfigCategory SERVER = SERVER_CONFIG
.category("server");
Multiple configs belonging to the same mod are grouped together by SSCL in integrations such as Mod Menu.