From 232a549ea46efc4171b998f183a0e25c52c721b4 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sun, 1 Sep 2024 18:10:30 +0800 Subject: [PATCH] add some methods to documentation --- docs/apidoc/events.md | 0 docs/apidoc/index.md | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/apidoc/events.md diff --git a/docs/apidoc/events.md b/docs/apidoc/events.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/apidoc/index.md b/docs/apidoc/index.md index 948fe1d..bd08428 100644 --- a/docs/apidoc/index.md +++ b/docs/apidoc/index.md @@ -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"`. \ No newline at end of file + - 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()` \ No newline at end of file