Modding:World Access: Difference between revisions

From Vintage Story Wiki
Line 24: Line 24:
* after the world has loaded you could register to the RunGame phase: <code>api.Event.ServerRunPhase(EnumServerRunPhase.RunGame, OnRunGame);</code>
* after the world has loaded you could register to the RunGame phase: <code>api.Event.ServerRunPhase(EnumServerRunPhase.RunGame, OnRunGame);</code>
* during world generation we'd have to register to the [[WorldGen API|appropriate world gen events]].
* during world generation we'd have to register to the [[WorldGen API|appropriate world gen events]].
* when the player runs a command has to type we can register a command: <code>api.RegisterCommand("test", "a test command", "", OnCommand);</code>
* when the player runs a custom command we need to register one: <code>api.RegisterCommand("test", "a test command", "", OnCommand);</code>
* when a player joins the game: <code>api.Event.PlayerJoin(OnPlayerJoin);</code>
* when a player joins the game: <code>api.Event.PlayerJoin(OnPlayerJoin);</code>


Confirmedusers, Bureaucrats, editor, Administrators
1,778

edits