# Module

### `unregister(): Undefined`

Unregisters the module.

### `toggle(): Undefined`

Toggles the module.

### `getName(): String`

Returns the module name.

### `getTag(): String`

Returns the module tag for arraylists.

### `getCategory(): String`

Returns the module category.

### `getDescription(): String`

Returns the module description.

### `isEnabled(): Boolean`

Returns if the module is enabled or not.

### `handle(type, handler): Undefined`

<table><thead><tr><th width="125">Argument</th><th width="391">Type</th><th width="235">Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>String</code></td><td>The type of event to handle.</td></tr><tr><td><code>handler</code></td><td><code>function (args: String[]): Undefined</code></td><td>Callback function.</td></tr></tbody></table>

Adds a event handler. Handler lists can be found in [events documentation](https://riseclients-organization.gitbook.io/rise-6-scripting-api/api-documentation/events).

### `setEnabled(enabled): Undefined`

<table><thead><tr><th width="125">Argument</th><th width="391">Type</th><th width="235">Description</th></tr></thead><tbody><tr><td><code>enabled</code></td><td><code>Boolean</code></td><td>Whether the module will be enabled.</td></tr></tbody></table>

Enables/disables the module.

### `registerSetting(type, name, defaultValue, params...): Undefined`

<table><thead><tr><th width="193">Argument</th><th width="143">Type</th><th width="411">Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>String</code></td><td>The type of setting to register. Currently supported types are: <code>string</code>, <code>number</code>, <code>boundsnumber</code>, <code>boolean</code>, <code>color</code>, or <code>mode</code>.</td></tr><tr><td><code>name</code></td><td><code>String</code></td><td>Setting name.</td></tr><tr><td><code>defaultValue</code></td><td>See the description</td><td>Default value for the setting. Type is: <code>string</code> for string settings and mode setting, <code>Number</code> for <code>number</code>, <code>boundsnumber</code> settings, <code>Boolean</code> for <code>boolean</code> settings, and 3 or 4 element <code>Number</code> array for color settings, with the elements corresponding to RGBA.</td></tr><tr><td><code>params...</code></td><td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Rest_parameters">Vararg </a><code>any</code></td><td>Additional parameters. See below.</td></tr></tbody></table>

Registers a setting to the module.&#x20;

For the `number` setting, the first and second additional parameters are minimum and maximum bounds for the setting, while the third one is for the decimal places (**not required, defaults to 2 decimal places.**) Default value type is JS Number.

For the `boundsnumber` setting, the first additional parameters argument is the second default value. 2nd and 3rd arguments are minimum and maximum bounds for both of the numbers. The last parameter is step size for the setting. Default value type is JS Number.

For the `boolean` and `string` settings, the additional parameters do not exist. Default values for them correspond to their JavaScript types.

For the `color` setting, there are no additional parameters. Default value type is a 3 or 4 element array, with the elements corrseponding to the RGB(A) channel values. 4th element for the Alpha channel in the array is not required.

For the `mode` setting, the additional parameters are all the sub-modes.

### `setSetting(name, value): Undefined`

<table><thead><tr><th width="193">Argument</th><th width="143">Type</th><th width="411">Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>String</code></td><td>Setting name.</td></tr><tr><td><code>value</code></td><td>See the description</td><td>The new value for the setting. Type is: <code>string</code> for string settings and mode setting, <code>Number</code> for <code>number</code>, <code>boundsnumber</code> settings, <code>Boolean</code> for <code>boolean</code> settings, and 3 or 4 element <code>Number</code> array for color settings, with the elements corresponding to RGBA.</td></tr></tbody></table>

Sets a setting of the module. Read the doucmentation for the method above to see more information.

### `getSetting(name): Boolean || Number[] || Number || String`

<table><thead><tr><th width="193">Argument</th><th width="143">Type</th><th width="411">Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>String</code></td><td>Setting name.</td></tr></tbody></table>

Returns the setting value.

For the `boolean` setting, it returns a Boolean object.

For the `string` setting, it returns a String object.

For the `boundsnumber` setting, it returns a 2 element array, with the 1st element corresponding to the 1st value and the 2nd element corresponding to the 2nd value.

For the `number` setting, it returns a Number object.

For the `color` setting, it returns a 4-element array that you can use in other scripting APIs (Like the [Render API](https://riseclients-organization.gitbook.io/rise-6-scripting-api/api-documentation/global-namespaces/render)).

For the `mode` setting, it returns the `mode` name.

{% hint style="danger" %}
If the setting is not found, this method returns null.
{% endhint %}

### `setSettingVisibility(name, visible): Undefined`

<table><thead><tr><th width="193">Argument</th><th width="143">Type</th><th width="411">Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>String</code></td><td>Setting name.</td></tr><tr><td><code>visible</code></td><td><code>Boolean</code></td><td>Whether to draw the setting or not.</td></tr></tbody></table>

Sets the setting visibility.

{% hint style="warning" %}
You have to call this method whenever you want to update setting visibility, it does not update automatically.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://riseclients-organization.gitbook.io/rise-6-scripting-api/api-documentation/objects/module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
