Closed thexaero closed 7 months ago
Use the value to do what?
Not drop resources if destroying a block doesn't succeed, fixing the dupe.
Thanks so much for the fix! I see that you also changed how you use the event. To clarify, I meant that the event is spammed even without your mod, for vanilla mobs. It's unusable by default, not because of how you used it specifically.
In vanilla it's called only by the dragon, the wither and zombies breaking doors
For zombies destroying turtle eggs too. The problem is that it's called from RemoveBlockGoal.isValidTarget
which is called for every checked position in findNearestBlock()
, not just the actual target block. The event is fired before even the blockstate is checked to be the right one. I don't know if this is useful for something that I'm not aware of, but certainly not good for claim permission checks.
The returned boolean tells you if destroying the block succeeds. This is related to issue #142. The
LivingDestroyBlockEvent
is spammed like crazy, even with no mods, for blocks most of which aren't even the ones being broken. Checking claim permissions every time it's fired doesn't seem like a good idea to me. The event name is pretty misleading tbh.