A common question amongst Minecraft server administrators is whether WorldGuard, or a similar protection plugin, will work on modded platforms such as Forge, NeoForge or Fabric. If you look around or go searching for alternatives, you’ll quickly find that very few exist and the ones that do are very limited in what they can actually do. While server plugin frameworks such as Paper or Spigot have many options available, this isn’t the case for modded platforms. Due to the way modded platforms work compared to server-only ones like Paper and Spigot, it’s nearly impossible for a protection mod to provide the same level of compatibility and functionality. In this article I’ll explain why, and what would have to change to make it possible.

Why can’t WorldGuard work on modded platforms?

To understand why WorldGuard won’t work on modded platforms like Forge, NeoForge, or Fabric, we need to first cover why it can work on Paper, or the Bukkit API which Paper is built on.

Why do they work on Paper?

Bukkit provides a layer that allows plugins to work without ever directly interfacing with Minecraft. It does this by providing “events” that get forwarded to plugins whenever different actions occur. As plugins can’t easily bypass Bukkit to interface with the game, it provides an extremely large number of events to allow plugins to listen to almost any action in the game. Plugins can then cancel these events to prevent them occurring in game, which is what protection plugins like WorldGuard do. If a player or plugin does something that isn’t allowed in that area, WorldGuard will cancel the event that Bukkit fires for that action. For most actions caused by plugins, Bukkit will still send events, and in other cases plugin developers can and generally do call events when necessary.

How modded platforms work in contrast

Forge, NeoForge, and Fabric on the other hand, provide full access to directly interface and modify the code of the game. They do provide a limited number of events, but these are mostly to reduce mod conflicts caused by multiple mods wanting to add their own events at the same spot. As the events are mostly to reduce conflicts, mods are less likely to actually call the events when they perform relevant actions. Due to the small number of events and less likelihood of mods calling events, any protection mod would require every single other mod to respect protections. Mods are also capable of altering the code at a much lower level, meaning these events might not even be called consistently by vanilla Minecraft mechanics.

Mods add complexity

For protections that aren’t covered by the basic events provided by these platforms, which would include a majority of the non-building flags within WorldGuard, it becomes an even messier situation. A protection mod would need to add its own events to cover these situations, which increases chances of mod conflicts while also substantially increasing the burden on other mod developers to support protection plugins. This would mean every single mod author would not only have to correctly fire the mod platform’s events but also fire the events of every protection plugin too. While this might partially work with one single popular protection plugin, the second multiple are introduced it would create fragmentation in which mods support which protections.

How can the situation improve?

Without substantial changes to the culture around mod development, this can’t easily be solved. Most other methods to solve this problem aren’t feasible, such as adding a similar level of event coverage to these platforms as Bukkit has. The simplest way would be for all mod developers to choose a single protection mod (or protection mod API for protection mods to build on top of) and add in support within their mods. This still wouldn’t be 100% perfect due to it being easier for bugs to slip in with the deeper levels of control that mods allow , but a cultural shift towards allowing protection mods would be necessary. This could even be normalized within tutorials for beginner modders, to get the idea of protection plugin support ingrained from the very start. Part of the underlying issue is that many mod developers are not building their mods for large servers to run and moderate, they’re building them for individuals or small groups of people to play around with.

The easiest way to solve this problem would be for an “official” or “officially recommended” API for modded platforms that allows consolidation of protection systems within the game. Protection plugins would implement their checks on top of this framework, and mods would check with that framework whether actions are allowed. Due to the complexity of protection systems however, this would have some drawbacks in limiting the capabilities of the various different systems. Despite this, it would vastly improve the situation from what it is currently. This would also be a vast undertaking, making it unlikely that these platforms could dedicate time to it. It’d be much more likely a community project would become officially recommended and the de facto standard, akin to the Vault project on Bukkit-based platforms that handles interoperability of numerous systems.

Conclusion

Overall, the current state of the modded Minecraft ecosystem and modding to a wider degree makes it difficult for these kinds of platforms to support protection systems like WorldGuard. While it’s possible to implement the basics with the Forge, NeoForge, and Fabric APIs, the raw power that mods command over the game means it’s vastly easier for them to accidentally bypass protections. While an officially recommended protections API for interoperability could work, it’d be a vast undertaking and would still not provide the same level of power as platforms such as Paper.

About the Author
Maddy Miller

Hi, I'm Maddy Miller, a Senior Software Engineer at Clipchamp at Microsoft. In my spare time I love writing articles, and I also develop the Minecraft mods WorldEdit, WorldGuard, and CraftBook. My opinions are my own and do not represent those of my employer in any capacity. Find out more.