Plugin API - TheIronG/Nodecraft GitHub Wiki
The plugin API is very simple. Every event emitted by a client is in snake_case
, and has a corresponding camelCase
API method.
For example, when the client requests the server info for the multiplayer list, it emits server_info_ping
which calls onServerInfoPing
in the plugin API
(Almost) Every API method that has a sender
argument will also have a packet
argument. However not all events utilize this packet if it exists
NOTE: Each plugin will hook it's own instance of each event! Meaning, for example, a
onChat
event hooked by 2 different plugins ("plugin1" and "plugin2") will be 2 seperate, isolated, events! Changing the packet data in "plugin1" will NOT be reflected in the packet data of "plugin2". Because of this, you can NOT overwrite events (cannot change the functionality of the "server_logic" plugins, for example), cancel events, etc! I do not know how to properly implement that type of functionality!