Minecraft version
26.1.x
Describe the bug
The game crashes when mods hook into PlayerBlockBreakEvents.BEFORE and run server-only code
Steps to reproduce
- Install Enchancement (example where it crashes)
- Enchant a pickaxe with Extracting
- Mine any set of ores to crash the game
Logs
https://gist.github.com/MoriyaShiine/56db7ea387da57cd2ae30ece60deb203
Additional context
On Fabric, this event only runs on the server, while on FFAPI, it runs on both client and server. This can cause problems because mods (such as Enchancement) expect the event to only run on the server so casting to ServerLevel is safe, but on NeoForge this is not the case.
I'm unsure if there are any other events that fall victim to this but it might be worth looking into :p
Minecraft version
26.1.x
Describe the bug
The game crashes when mods hook into PlayerBlockBreakEvents.BEFORE and run server-only code
Steps to reproduce
Logs
https://gist.github.com/MoriyaShiine/56db7ea387da57cd2ae30ece60deb203
Additional context
On Fabric, this event only runs on the server, while on FFAPI, it runs on both client and server. This can cause problems because mods (such as Enchancement) expect the event to only run on the server so casting to ServerLevel is safe, but on NeoForge this is not the case.
I'm unsure if there are any other events that fall victim to this but it might be worth looking into :p