Name | Switch |
Syntax | switch [<location>|...] (state:{toggle}/on/off) (duration:<value>) (no_physics) |
Short Description | Switches state of the block. |
Full Description | Changes the state of a block at the given location, or list of blocks at the given locations.
Optionally specify "state:on" to turn a block on (or open it, or whatever as applicable) or "state:off" to turn it off (or close it, etc). By default, will toggle the state (on to off, or off to on). Optionally specify the "duration" argument to set a length of time after which the block will return to the original state. Works on any interactable blocks, including: - the standard toggling levers, doors, gates... - Single-use interactables like buttons, note blocks, dispensers, droppers, ... - Redstone interactables like repeaters, ... - Special interactables like tripwires, ... - Bells as a special case will ring when you use 'switch' on them, ... - Almost any other block with an interaction handler. This will generally (but not always) function equivalently to a user right-clicking the block (so it will open and close doors, flip levers on and off, press and depress buttons, ...). Optionally specify 'no_physics' to not apply a physics update after switching. |
Related Tags | <LocationTag.switched> Returns whether the block at the location is considered to be switched on. (...)
<MaterialTag.switched> Returns whether a material is 'switched on', which has different semantic meaning depending on the material type. (...)
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Synonyms (Search Aid) | toggle, lever, activate, power, redstone |
Group | world |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/SwitchCommand.java#L37 |