添加了使用 KubeJS 脚本创建自定义 Forge toml 配置文件的功能,有关详细信息和用法,请查阅 Wiki。
以下是一个创建配置文件的实例:
ConfigsEvent.common((event) => {
event.setName("My Very Cool Config File");
event.push("debug");
event.comment(
"Determines how many particles should be spawned around the player in debug mode"
);
global.debugParticleCount = event.intValue("numberOfParticles", 0, 0, 20);
event.comment("Determines if debug mode is enabled");
global.debugEnabled = event.booleanValue("enabled", false);
event.pop();
event.comment("be wild!");
global.selector = event.enumValue("selectorType", "basic", [
"basic",
"advanced",
"supreme",
]);
});