Mods bypassing event triggers

I have been testing the sponge plugin Directscript for the author and I have come across some issues related to flans mod but could be extended to other mods if they operate the same way. Using the plugin I am able to cancel entity spawn events and explosion events etc however the issue that I have come across is what about mods that fire silent spawn events or bypass the explosion event. An example of this is flans when a gun fire it spawns an entity type called bullet. This is fine and can be canceled however the grenade launcher spawns a visible entity that does not fire a spawn entity event. Furthermore when this entity impacts a block/player or travels a certain distance it explodes. This explosion does not fire a explosion event or a blockbreak event. I was curious if there was a solution to this or if it is not possible due to the way the Flan wrote his mod.

Ultimately it’s the mod’s responsibility to fire the event and handle it. It’s very hard to know what a mod is doing if they don’t report it through events.
The only way to overcome this is to report to the mod author that they should be firing the appropriate events when they intend to do something.
Because events are not enforced it’s completely possible for a mod to avoid firing any but in the interest of compatibility with other mods they should be.

tl;dr Tell Flan to fire events

Alright, I understand. I will try to contact mod developers that aren’t firing events and let them know it would be appreciated if they did. Another mod I have noticed that does this is Custom Npcs; when an npc is set up to use explosive projectiles the explosion from the projectile doesn’t fire an explosion event.

@blood shouldn’t this have been covered by the event tracking changes you made? Or are the developers being extra sneaky?

1 Like

Ive said this many times before. So many mods are destroying blocks without events. Cant protect against em even if you tried. And some mod authors will respond and change code. But so many more wont. (Not to my requests anyhow) Its going to be a long road to having good area/block protection and lots of mods. Probably a bit off topic here.

@GhazRanka Nice to see you on our forums =) Please test build 817 and let me know if it fixes your issue.

@blood Glad to see you remember me! (I remember the old days of bug testing your port of flans to mcpc+) Thanks for that update we were able to find the cause of the explosion we will be able to cancel the block breaking. A side note is when the grenade entity spawns it does not show up in sponges debug but when it breaks blocks it does show up as the root cause.

@GhazRanka what debug are you referring to? If you mean the debug logging, that isn’t fully complete. Plus, you can easily create your own debugging with a plugin.