Toggle
Provides a boolean state that can be cycled with either a key or the toggle_power action type.
Type ID: kaya:toggle
Format
| Field | Type | Default | Description |
|---|---|---|---|
action |
Action | optional | If specified, this action will be executed when the boolean state of the power is cycled. |
key |
Key Reference | optional | If specified, the boolean state of this power will be cycled if a key that matches this reference is pressed. |
retain_state |
Boolean Provider | true |
Determines whether the boolean state will remain even if the power is no longer active. |
active_by_default |
Boolean Provider | true |
Determines whether the boolean state should be active by default. |
Example
{
"type": "kaya:toggle",
"action": {
"type": "kaya:execute_command",
"source": {
"type": "kaya:entity",
"entity": "this"
},
"command": "me toggled a power!"
},
"key": "key.loadToolbarActivator"
}
This example provides a toggle that can be cycled by pressing the key.loadToolbarActivator keybinding.
History
| Minecraft | Mod | Changelog |
| 1.21.5 | 0.1.0 | Added the type. |