In events triggered by player interaction with the game, make it possible to cancel (or maybe even modify) the effects of the player action.
For example:
- In an event triggered when player attacks an antity, make it possible to prevent the entity from taking damage and prevent the damage sensor component from triggering an event.
- In an event triggered when player places a block into the world, make it possible to prevent the block from being placed into the world (and also prevent destroying fire or tall grass caused by placing the block).
- In an event triggered when player right clicks on a block, prevent the crafting gui from openning after clicking a crafting table
Note: not all these events exist in the api, they are only examples
Cancelling player actions can be implemented both in server script and in client script. Implementing it also in client script will have the advantage that players won't see the action happen and then being reverted when the latency is high (currently when placing a block it immidiately appears in the world without waiting for the server).
Please sign in to leave a comment.
0 Comments