1.20.1: ModConfigEvent fires on mod bus, not MinecraftForge.EVENT_BUS. Moved Loading/Reloading to FMLJavaModLoadingContext.getModEventBus(). Added config file header warning about preserving [section] headers. Debug logging in RulesCommand prints token length + channel at runtime. All 6 builds bumped to 1.0.3. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Architectural Response
Re: REQ-2026-04-13-rules-mod-config-not-read-at-runtime Date: 2026-04-13
1. Root Cause (two bugs)
Bug 1: Wrong event bus (1.20.1 only). ModConfigEvent.Loading and Reloading fire on the mod event bus, not MinecraftForge.EVENT_BUS. The @SubscribeEvent handlers were registered on the wrong bus and never fired. Fixed by switching to FMLJavaModLoadingContext.get().getModEventBus().addListener().
Bug 2: Config file section headers removed. The Chronicler's config file had values at the top level without [discord] section headers. ForgeConfigSpec looks for discord.bot_token — without the section, it can't find the values and returns defaults.
2. Fixes Applied (all 6 builds, v1.0.3)
- 1.20.1: Config events moved to mod event bus
- All versions: Added prominent warning comment to generated config file
- 1.20.1: Added debug logging in RulesCommand (token length + channel ID)
- INSTALL.md: Section header preservation warning added
3. Chronicler Deploy Steps
- Stop Otherworld
- Replace jar with firefrostrules-1.0.3-1.20.1-forge.jar
- Delete config/firefrostrules-common.toml
- Start server — generates fresh config with section headers
- Stop server
- Edit ONLY the values under [discord] — keep headers intact
- Start server — check logs for "config loaded successfully"
- Player runs /rules — should show real Discord rules