ModeSetting
Last updated
A mode setting.
new ModeSetting(
owner,name,description,defaultValue,values):ModeSetting
Parameters
owner
object
Can either be 'script' or a subgroup.
name
string
The name of the setting.
description
string
The description of the setting.
defaultValue
string
The default mode of the setting.
values
string[]
An array of possible mode for the setting.
Returns
ModeSetting
Overrides
Setting.constructor
description():
string
Returns
string
The description of the setting.
Overrides
getValue():
string
Returns
string
The name of the currently selected mode.
is(
mode):boolean
Check if the requested mode is the current one.
Parameters
mode
string
The mode you want to check.
Returns
boolean
True if the mode is currently selected
name():
string
Returns
string
The name of the setting.
Overrides
setValue(
mode):void
Parameters
mode
string
The mode you want to set the setting to.
Returns
void
visible(
visible):void
You can use this to hide settings temporarily depending on the user config. The callback should return a boolean.
Parameters
visible
Function
The function to determine if the setting should be visible or not.
Returns
void
Example
Inherited from
Last updated
const delay = new IntSetting("Delay", "The amount of ticks to wait in between attacks.", false);
delay.visible(() => {
return someOtherSetting.getValue()
});