Event when biters despawn?

Place to get help with not working mods / modding interface.
Post Reply
repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Event when biters despawn?

Post by repne-scasb »

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?
Last edited by repne-scasb on Mon Mar 06, 2023 2:49 pm, edited 1 time in total.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 628
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Event when biters despawn?

Post by Xorimuth »

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

repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: Event when biters despawn?

Post by repne-scasb »

Xorimuth wrote:
Mon Mar 06, 2023 2:35 pm
Pretty sure that register_on_entity_destroyed + on_entity_destroyed is the way to go here.
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).

Post Reply

Return to “Modding help”