I want to prevent a player from placing a certain building under certain circumstances. Collision mask is not precise enough, and the on_pre_player_built_entity event does not exist. So I have to listen for the on_built_entity event and the destroy the building and refund the build cost.
Has any other mod solved this problem?
Best way to cancel a building?
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Best way to cancel a building?
If you don't mind waiting a month for 0.17, you could ask to see if on_pre_player_built_entity could be implemented.
Re: Best way to cancel a building?
That's what the on-put-item event is. It literally fires before building an entity and only before building an entity.bobingabout wrote: ↑Tue Dec 18, 2018 10:01 amIf you don't mind waiting a month for 0.17, you could ask to see if on_pre_player_built_entity could be implemented.
If you want to get ahold of me I'm almost always on Discord.
Re: Best way to cancel a building?
Thanks for the hint, it seems Nexela is using the same approach as me because on_put_item doesn't work.
viewtopic.php?t=29887
viewtopic.php?t=29887