I can see that when I place a ghost entity and then mine it, some of these events are called - specifically, on_preplayer_mined_item.
If I use the deconstruction planner to remove the ghost entity, however, none of these events are called.
I have the following events registered to listen for destruction of an entity:
Code: Select all
script.on_event(defines.events.on_preplayer_mined_item, on_preplayer_mined_item)
script.on_event(defines.events.on_player_mined_item, on_player_mined_item)
script.on_event(defines.events.on_robot_pre_mined, on_robot_pre_mined)
script.on_event(defines.events.on_robot_mined, on_robot_mined)
script.on_event(defines.events.on_entity_died, on_entity_died)
script.on_event(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction)
Expected:
- One of these events is called when a ghost entity is destroyed with the deconstruction planner
- Consistent with what happens when a user mines the entity
What happens:
- None of them are called