Fabric API

Fabric API

111M Downloads

[Feature Request] Add mob griefing event

MichaelHillcox opened this issue ยท 2 comments

commented

I'd like to request a Forge/NeoForge like MobGriefingEvent that would allow mods to block mobs from griefing an area in the game.

The current target for this would be for things like the Endermen where they like to pick up blocks which is essentially the same as a player destroying the block.

Mods that would use this would be land claiming / protection based mods, blocks that prevent griefing, etc

The NeoForge implementation:
https://github.com/neoforged/NeoForge/blob/1.21.x/src/main/java/net/neoforged/neoforge/event/entity/EntityMobGriefingEvent.java

This looks to be deeply rooted in the breaking of a blocks checking but not so deeply that a mixin would be massively complicated

Let me know if you need any more information

commented

A very quick look suggests this is going to need patching in about 30 places (going by where the game rule is checked), and would be a nightmare to maintain going into new versions. If anyone has a good way to do this then it sounds like a reasonable idea.

commented

A very quick look suggests this is going to need patching in about 30 places (going by where the game rule is checked), and would be a nightmare to maintain going into new versions. If anyone has a good way to do this then it sounds like a reasonable idea.

Can't we just mixin into the can mobs grief gamerule check?