Including Other Scripts#
By calling the function below in your scripts during the Parsing/Loading stage, you can include and execute other JavaScript files.
| Functions | Description |
|---|---|
static include(relPath: String): void |
Loads and runs another JS file relative to the current JS file. |
static include(path: Identifier): void |
Loads and runs the JS file by an Identifier in the resource pack. For example: include(Resources.id(“mtr:path/absolute.js”)). |