-
Notifications
You must be signed in to change notification settings - Fork 5
Config
Lortseam edited this page Sep 3, 2023
·
15 revisions
The ConfigOptions class contains several options:
public class MyConfig extends Config {
public MyConfig() {
super(ConfigOptions.mod("modid")
.branch(/*...*/)
.typeSerializers(/*...*/)
.objectMapperFactory(/*...*/)
.fileHeader(/*...*/));
}
}The branch determines the location of the config file. If your mod has multiple configs, each one needs a unique branch. The default branch is the empty branch, the config file path is .minecraft/config/modid.conf.
ConfigOptions.mod("modid").branch(new String[]{"branch", "config"})In this case, the config file path is .minecraft/config/modid/branch/config.conf.
Type serializers and object mapper factories can be used to support custom entry types. See Types for more information.
The file header is a comment added to the top of the config file.