Scripting plugins for various scripting languages are provided here:
- JavaScript - powered by duktape
- LUA - powered by LUA (https://www.lua.org/)
- Python - powered by Python (https://www.python.org/)
The following functionality is available to scripts:
Attempts to parse the input as either a block ID or block name
Returns -1 if the input failed to be parsed
Returns the current field of view of the camera in degrees
Returns whether the current camera is a third person camera
Returns the current X position of the camera
Returns the current Y position of the camera (vertical)
Returns the current Z position of the camera
Returns the current yaw of the camera in degrees
Returns the current pitch of the camera in degrees
Adds a chat message
Adds a chat message with the given type (See here)
Sends the given chat message to the server
Note: If server is singleplayer, this method is the same as add
Note: /client is always interpreted as client-side commands
Called whenever a chat message has been received (including user input)
Called whenever a chat message has been sent to the server
Sets the block of the horizon that surrounds the world
Default: Water block
Sets the elevation of the horizon that surrounds the world
Default: world.getHeight() / 2
Sets the block of the borders around the world
Default: Bedrock block
Sets the offset of borders elevation from horizon elevation
Default: -2
Sets the elevation of the clouds
Default: world.getHeight() + 2
Sets the speed that clouds move at
Default: 1.0
Sets the weather of the world (sunny/rainy/snowy)
Default: 0 (sunny)
Sets the speed that rain/snow falls at
Default: 1.0
Note: negative values 'fall upwards' instead
Sets how quickly rain/snow fades out over distance
Default: 1.0
Note: Smaller values make rain/snow appear thicker
Attempts to set the block at the given coordinates to the given block ID
Note: Returns empty string if the block was successfully updated.
Otherwise returns reason why the block change failed. (e.g. too far away, -hax in MOTD)
Note: Clientside change only - the server is not informed of the change
Attempts to change the block at the given coordinates to the given block ID
Note: Returns empty string if the block was successfully updated.
Otherwise returns reason why the block change failed. (e.g. too far away, -hax in MOTD)
Note: The server is informed of the change
Returns the block ID the player is currently holding in their hand
Returns the current reach distance of the player
Returns the current X position of the player
Returns the current Y position of the player (vertical)
Returns the current Z position of the player
Returns the current yaw of the player in degrees
Returns the current pitch of the player in degrees
Returns the current server MOTD (usually this is the second line in the loading map screen)
Returns the current server name (usually this is the first line in the loading map screen)
Returns the address of the server (e.g. 127.0.0.1)
Returns the port of the server (e.g. 25565)
Returns the current application name (the name that appears in /clients)
Sets the application name (the name that appears in /clients)
Note: This is only sent to the server on initial connection
Returns whether the server is the internal singleplayer server
Sends the given raw bytes to the server
Note: Does nothing if server is singleplayer
Raised when the user successfully connects to the server
Raises when the user is disconnected from the server
Returns the player name of the given tablist entry (e.g. TestName)
Returns the formatted name of the given tablist entry (e.g. &a[OP] Test&bName)
Returns the group name of the given tablist entry (e.g. Players)
Returns the rank of the given tablist entry within the group (e.g. 10)
Returns the tablist entry with the given ID
Creates or updates the tablist entry with the given ID
Returns the width of the current world
Returns the height of the current world
Returns the length of the current world
Returns the block at the given coordinates in the current world
Raised when the current world is unloaded
Raised when a new world has finished loading
Note: This event is still raised even when an unsuccessful load occurs
(e.g. due to insufficient memory)
Sets the text that appears in the window's titlebar
Returns the native window handle