Denizen Script Events


Events are a way to listen to things that happened on your server and respond to them through a script. These usually pair with 'world' script containers.
Learn about how events work in The Beginner's Guide.


Showing 1 out of 17 events...
Nameinput_device key pressed|released|toggled
Event Lines <input_device> key pressed|released|toggled
Triggerswhen a keyboard/mouse key is pressed.
Example
# Will send the server an event when the 'K' key is pressed
on keyboard key pressed name:k:
- serverevent id:activate_ability
Example
# Will listen to all presses on the keypad
on keyboard key pressed name:KEYPAD_*:
- narrate "You pressed the <context.key> key on your keypad!"
Switchesname:<key> to only process the event if the pressed key's name matches the specified matcher.
Contexts<context.key> returns an ElementTag of the pressed key's name.
<context.device> returns an ElementTag of the device used, will be either KEYBOARD or MOUSE.
<context.key_code> returns an ElementTag(Number) of the pressed key's raw key code.
Groupinput
Sourcehttps://github.com/DenizenScript/Clientizen/blob/master/src/main/java/com/denizenscript/clientizen/events/KeyPressReleaseScriptEvent.java#L13