Events
Where your script code goes to be run at a certain time

Info

How to cancel an event

1
event.cancel() or event.setCancelled(true)
Copied!
This will cancel the event.

Enable

1
script.onEnable(function () {...
Copied!
This event will be called every time the script is enabled.

Disable

1
script.onDisable(function () {...
Copied!
This event will be called every time the script is disabled.

Packet Send

1
script.onPacketSend(function (event) {...
Copied!
Called before packets are sent to server.

Functions

Function
Description
getPacketID()
Returns the packet ID as a Number

​Packet Receive​

1
script.onPacketReceive(function (event) {...
Copied!
Called on packets received, before the client handles them.

Tick

1
script.onTick(function (event) {...
Copied!
Called on each tick.

Motion

1
script.onMotion(function (event) {...
Copied!
Called on motion updates.

Functions

Function
Description
setX(x)
Sets the players x position using the event
setY(y)
Sets the players y position using the event
setZ(z)
Sets the players z position using the event
getX()
Returns the current x pos of the player
getY()
Returns the current y pos of the player
getZ()
Returns the current z pos of the player
isOnGround()
Returns true the player is on ground
setGround(ground)
Sets the player's on ground state to the new state
getYaw()
Returns the players yaw as a Number
setYaw(yaw)
Sets the players yaw using the event
getPitch()
Returns the players pitch as a Number
setPitch(pitch)
Sets the players pitch using the event
isPre()
Returns true the event is onPre
isPost()
Returns true the event is onPost
setRotations(yaw, pitch)
Sets the players yaw and pitch at the same time

Move

1
script.onMove(function (event) {...
Copied!
Called when a player is moving.
Function
Description
setX(x)
Sets the players x position using the event
setY(y)
Sets the players y position using the event
setZ(z)
Sets the players z position using the event
getX()
Returns the current x pos of the player
getY()
Returns the current y pos of the player
getZ()
Returns the current z pos of the player
setSpeed(speed)
sets the the speed of the player

Render 3D

1
script.onRender3D(function (event) {...
Copied!
Called on the rendering of 3D objects.

Functions

Function
Description
getTicks()
Returns the event's ticks as a Number

Render 2D

1
script.onRender2D(function (event) {...
Copied!
Called on the rendering of 2D objects.

Shader

1
script.onShader(function (ev) {...
Copied!
Everything in this event will be blurred when PostProcessing module is enabled and blur or bloom is enabled. You can tell if Bloom is enabled by using one of the following functions and further you can see if Glow is enabled with another function.
Function
Description
isBloom()
Returns True if bloom is enabled
isGlow()
Returns True if bloom and glow are enabled

ChatReceivedEvent

1
script.onChatReceived(function (ev) {...
Copied!
This event is called every time a message is received in the chat

Functions

Function
Description
getRawMessage()
Returns the raw received message as a String

PlayerSendMessage

1
script.onPlayerSendMessage(function (ev) {...
Copied!
This event is called every time the player (i.e. the one using the script) sends a message in the chat

Functions

Function
Description
getMessage()
Returns the message as a String

WorldLoad

1
script.onWorldLoad(function (ev) {...
Copied!
This event is called when a world is loaded in