The days following a mod release are always hectic, and this past week was no exception. As much as I’d love to kick back and enjoy the positive feedback, there are always bugs to fix, and this release had its fair share.
This week, I addressed two major issues that cropped up post-release: a server crash and a failure to fully test the NeoForge version. Here’s how I tackled them and what I learned in the process.
Bug #1: Server Crash
Early in this version’s development, I refactored some of the mod’s code. Unfortunately, I missed a critical detail: the ClientEventListener
class was being created in the mod’s constructor. While this works perfectly on client builds, it causes an immediate crash on servers because the class doesn’t exist in those builds.
The issue was quickly brought to my attention thanks to a crash log shared on the CurseForge project page:
Hello just update my server and it crash because of this mod i have my crash log
Kyrianvt
Initially, I had no idea how to fix this. At the time the mod is constructed, the Minecraft
instance isn’t loaded yet, so I couldn’t check if the game was running in server or client mode.
After some quick research (thank you, Google), I discovered the FMLEnvironment.dist
property, which identifies whether the game is running on a client or server. So, I added a simple conditional check to resolve the issue:
// Create the Mod event listeners if (FMLEnvironment.dist == Dist.CLIENT) { new ClientEventListener(modEventBus, blockEntityTypeRegistry, entityTypeRegistry); }
Bug #2: NeoForge Data Issues
The second issue was a bit more embarrassing: everything was broken in the NeoForge version of the mod. Butterflies weren’t spawning, items weren’t dropping correctly, and many features simply didn’t work.
The root cause? I forgot to generate data for the NeoForge version before building the release. Some loot tables and biome modifiers were still referencing Forge instead of NeoForge, rendering the mod unusable on 1.20.4.
Thankfully, the fix was straightforward: regenerate the data with the correct values. With that done, everything now works as intended.
Lessons Learned
These bugs highlighted some key areas where I need to improve:
- Rigorous Testing
Both issues could have been caught early if I’d tested server builds and run more focused tests on specific versions. Instead, they slipped through the cracks, impacting players first. - Shorter Release Cycles
This release included a massive number of features, making testing for each version a monumental task. By releasing updates more frequently, I can reduce the workload for each release and ensure features are thoroughly tested before they go live.
Moving Forward
From now on, I’m committing to:
- More frequent updates to keep the mod fresh and manageable.
- Stricter testing protocols to catch issues before they reach players.
While this week has been a scramble to fix things, it’s also been a valuable learning experience. Thank you to everyone who reported bugs and offered feedback, you’re helping make Bok’s Banging Butterflies better with every release.
Here’s to smoother updates in the future!