I have a custom entity, for which I store additional information in a global table referenced by unit_number. For copy/paste/blueprint I am able to save and restore these information using tags.
Now I also want to restore this information after I mined this entity and restore its ghost with undo. Is this possible?
What I basically need is something like this:
Code: Select all
function on_player_entity_mined(event)
if event.entity.name == "my-entity" then
-- these tags are stored in the ghost, which is created with undo
event.tags = create_tags(event.entity)
end
end
Can someone help me with this?
Thanks, Jaren