Notes

Consume?

When N the event is always passed to the next in line. When Y returning truthy from the function will prevent any more listeners receiving the event.


Menu and Client Events

Event Available Can Consume Description
CLIENT_CHAT_MESSAGE_RECEIVED compat v0.1.2 Occurs when a chat message is received by the client.
CLIENT_KEY_CLICKED compat v0.1.2 Occurs when a client key has been clicked. The keycode this event provides can be checked against the GLFW keycodes http://www.glfw.org/docs/latest/group__keys.html to determine the key that has been clicked.
CLIENT_WINDOW_FOCUS_LOST compat v0.1.2 Occurs when the game window has lost focus.
CLIENT_OTHER_CLIENT_CONNECTED compat v0.1.2 Occurs when another player connects to the same server the client is on. If other players are on the server before the client connected, this event created for the client for every other player. This means that when connecting to the server, this event may be created multiple times.
CLIENT_OTHER_CLIENT_DISCONNECTED compat v0.1.2 Occurs when another player on the same server as the client disconnects.
CLIENT_CHAT_MESSAGE_PRE_SENT compat v0.1.2 Occurs when the client attempts to send a chat message, before it is sent to the server. This can be used to swallow chat commands so they are not sent to the server.
CLIENT_UPDATED compat v0.1.5
CLIENT_APPLICATION_SHUTDOWN compat v0.1.2
CLIENT_SESSION_SHUTDOWN_BEGUN compat v0.1.2
CLIENT_SESSION_SHUTDOWN_COMPLETED compat v0.1.2
CLIENT_SESSION_STARTED compat v0.1.2

Server Events

Event Available from Can Consume Description
SERVER_PLAYER_LOAD compat v0.1.2 N called per player when any player joins the server
SERVER_PLAYER_SAVE compat v0.1.2 N called per player when any player leaves the server, or the server shuts down
SERVER_ENTITY_PLACED compat v0.1.5 Y called when any entity or block is placed
SERVER_ENTITY_DESTROYED compat v0.1.5 Y called when any entity or block is destroyed
SERVER_CHAT_RECEIVED compat v0.1.5 Y called everytime a client chat message is received


CLIENT_CHAT_MESSAGE_RECEIVED

Occurs when a chat message is received by the client

from: compat v0.1.2

callback (author, message)
  • parameters
    author [string]
    author of the message. Does not have to be a player name.
    Can be empty string.
    Will not be nil.
    message [string]
    the message.
    Can be empty string
    Will not be nil.
  • return values
    none

CLIENT_KEY_CLICKED

Occurs when a client key has been clicked

from: compat v0.1.2

callback (keyCode, keyCharacter, keyModifier)
  • parameters
    keyCode [number]
    A value from dio.inputs.keyCodes representing the physical key pressed. See http://www.glfw.org/docs/latest/group__keys.html. To map a GLFW key code to Diorama keycode remove the GLFW_KEY_ prefix. i.e. GLFW_KEY_F12 becomes F12.
    Will not be nil.
    keyCharacter [string]
    A string representing the printable key pressed, if available.
    Can be nil - when the keyCode does not map to a regular character. Examples are ESCAPE, LEFT_SHIFT, PAGE_UP etc...
    keyModifier [bitfield]
    TBD

keyModifier

  • return values
    bool
    return truthy to consume the event

Twitch | Twitter