events

The global instance of the EventsAPI and its subtypes
field signature:
events
Method Property Fluent Description Representation
Field Type an EventsAPI

EventsAPI.ENTITY_INIT

The ENTITY_INIT event is run once this avatar's entity exists
field signature:
ENTITY_INIT
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.TICK

The TICK event is run every tick in-game if this avatar's entity exists
field signature:
TICK
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.WORLD_TICK

The WORLD_TICK event is run every in-game tick
field signature:
WORLD_TICK
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.RENDER

The RENDER event is run every frame, before the avatar is rendered
Takes a parameter delta,
which is a number from 0 to 1 indicating the proportion of the way the game is between ticks
A second parameter,
giving out context of the current RenderMode, with is a string with the name of the source of this render event
And a third paramenter,
being the source matrix used to render the Avatar
field signature:
RENDER
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.POST_RENDER

The POST_RENDER event runs every frame after the avatar is rendered
Takes a parameter delta,
which is a number from 0 to 1 indicating the proportion of the way the game is between ticks
A second parameter,
giving out context of the current RenderMode, with is a string with the name of the source of this render event
And a third parameter,
being the source matrix used to render the Avatar
field signature:
POST_RENDER
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.WORLD_RENDER

The WORLD_RENDER event is run every frame before the world is rendered
Always runs when a world is visible,
even when the avatar itself is not, so this runs even in first person
Takes a parameter delta,
which is a number from 0 to 1 indicating the proportion of the way the game is between ticks
field signature:
WORLD_RENDER
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.POST_WORLD_RENDER

The POST_WORLD_RENDER event runs every frame after the world is rendered
Always runs when a world is visible,
even when the avatar itself is not, so this runs even in first person
Takes a parameter delta,
which is a number from 0 to 1 indicating the proportion of the way the game is between ticks
field signature:
POST_WORLD_RENDER
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.CHAT_SEND_MESSAGE

The CHAT_SEND_MESSAGE event is run every time you send a message in chat
A string parameter is passed in,
which contains the message that was sent
The return value is chained to the next events of the same type,
whereas NIL cancels the message from being sent and any other value will modify the sent message (if allowed in the settings)
field signature:
CHAT_SEND_MESSAGE
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.CHAT_RECEIVE_MESSAGE

The CHAT_RECEIVE_MESSAGE event is run every time a message is received in chat
The first argument is the raw string of the received text
The second argument is a JSON string representation of the received text
If the first return value is not nil,
the message will be replaced with that value
If the first return value is false,
it will suppress adding this message
The second return value is,
optionally, an RGB vector which will be used as the background color for this message
field signature:
CHAT_RECEIVE_MESSAGE
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.SKULL_RENDER

Called on every one of your skull blocks placed in the world
It have 5 arguments,
as listed below:
(number) - the tick delta
(blockstate) - the block,
when rendered from a block
(itemstack) - the item,
when rendered from an item
(entity) - the entity, when rendered from an entity
(string) - the type of the rendering (LEFT_HAND,
HEAD, BLOCK, …)
If the return value is true, the skull will not render
field signature:
SKULL_RENDER
Method Property Fluent Description Representation
Field Type an Event

EventsAPI.MOUSE_SCROLL

The MOUSE_SCROLL event runs every time the mouse is scrolled
Takes a parameter delta,
which is the direction of the scroll
If returned true,
the event cancels its vanilla function
field signature:
MOUSE_SCROLL
Method Property Fluent Description Representation
Field Type an Event
a a