add some methods to documentation

This commit is contained in:
ZXMushroom63 2024-09-01 18:10:30 +08:00
parent f4fda26235
commit 232a549ea4
2 changed files with 17 additions and 1 deletions

0
docs/apidoc/events.md Normal file
View File

View File

@ -52,4 +52,20 @@ The global object has the following properties:
- `ModAPI.version: String`
- The version of ModAPI.
- `ModAPI.flavour: String`
- The flavour of ModAPI. Hardcoded to be `"injector"`.
- The flavour of ModAPI. Hardcoded to be `"injector"`.
The ModAPI object has the following methods:
- `addEventListener(eventName: String, callback: Function) : void`
- More: [EventDocumentation](events.md)
- `require(componentName: String) : void`
- Import required modules, such as `player` and `network`.
- Usage: `ModAPI.require("module")`
- `displayToChat(message: String) : void`
- Displays client-side message to user's ingame chat gui.
- Usage: `ModAPI.displayToChat("Hello World.")`
- `clickMouse() : void`
- Triggers a left click ingame.
- Usage: `ModAPI.clickMouse()`
- `rightClickMouse() : void`
- Triggers a right click ingame.
- Usage: `ModAPI.rightClickMouse()`