Hi! Is there an event that fires when a biter despawns? (or when it is removed from the world in any other way.) I need it to remove the biter from some list in my mod.
Currently I listen for on_entity_died (with type unit), but I don't think that event is fired in this case. Should I instead use register_on_entity_destroyed and listen for on_entity_destroyed or does that also not fire here?
Event when biters despawn?
-
- Burner Inserter
- Posts: 12
- Joined: Sun Jan 09, 2022 1:18 pm
- Contact:
Event when biters despawn?
Last edited by repne-scasb on Mon Mar 06, 2023 2:49 pm, edited 1 time in total.
Re: Event when biters despawn?
Pretty sure that register_on_entity_destroyed + on_entity_destroyed is the way to go here.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
-
- Burner Inserter
- Posts: 12
- Joined: Sun Jan 09, 2022 1:18 pm
- Contact:
Re: Event when biters despawn?
I think you might be right after all, I thought it didn't fire but maybe it does. Do you know any way to reproduce, i.e. get biters to despawn?
EDIT: I waited along on a group of biters without spawner and eventually they all despawned, indeed firing on_entity_destroyed (but not on_entity_died).