可以通过配置文件仅禁用特定命令的特定参数了

This commit is contained in:
xzb23 committed 2026-08-19 18:54:53 +08:00
1 parent 445a2addcd
commit d76c790a1a
2 files changed
+58 -27

No files matched your search

@@ -22,9 +22,13 @@ public class Config {
.defineInRange("version", 1, 0, Integer.MAX_VALUE);
public static final ModConfigSpec.ConfigValue<List<? extends String>> BLOCKED_COMMANDS = BUILDER
public static final ModConfigSpec.ConfigValue<List<? extends String>> BLOCKLIST = BUILDER
.comment("禁用的指令列表")
.defineList("blocked_commands", List.of("give", "fill"), obj -> obj instanceof String);
.comment("格式为{cmd/指令}:{checkIndex/禁用第几个参数}:{arg1[,arg2,...]/禁用的参数1[,禁用的参数2,...]}")
.comment("其中{checkIndex}填0代表禁用整个指令")
.defineList("blocked_commands", List.of("give:0:", "fill:0:", "gamemode:1:creative"), obj -> obj instanceof String);
public static final ModConfigSpec.ConfigValue<String> BROADCASTMSG = BUILDER