Page 1 of 1

Prevent pre_build from succeeding

Posted: Thu Jan 14, 2021 8:27 am
by PFQNiet
I want to run some checks on_pre_build and, if a check fails, I want to cancel the placement of the item. Is this possible?

I'd rather avoid shenanigans like "the next on_built_entity event should destroy the entity" but that's totally an option if there's no cleaner way.

Re: Prevent pre_build from succeeding

Posted: Thu Jan 14, 2021 8:42 am
by PFQNiet
I should really test before posting XD

If you change the contents of the player's cursor during this event, then you change what gets built. So in my case...

Code: Select all

game.players[event.player_index].clear_cursor()
This cancels the build event. Of course it also clears the cursor but in my use-case that's acceptable.