Events
Planetary Processing provides the ability for you to run functions when specific events occur. This is implemented in (optional) the events.lua
file in the root directory of your game repository. The default template repository comes with the following events file:
This simply causes the server to print out a message when a player joins or leaves. More events are being added constantly, however, currently they are limited to:
on_player_join
Called when a player joins the game.
player
- this player's entity
first
- boolean, true if this player has never joined before
on_player_leave
Called when a player leaves the game.
player
- this player's entity
Note that the Lua environment in use is that of the chunk where the event occurs, so you can still access data like the chunk
table.
Last updated