Introduction

Every function of the XiaoHook.cc Lua API for Minecraft Bedrock, with signatures and examples. Paint, packets, files, signals.

Welcome to the xiao Lua documentation.

Scripts run in an embedded LuaJIT 2.1 VM inside the client. The pages on the left list every function a script can call, with its exact signature, its behaviour and an example.

xiaohook.cc Discord


Usage

Every custom API lives under the global xiao table: xiao.paint, xiao.packet, xiao.fs... The standard Lua libraries keep their usual global names (math, string, table, os, bit, coroutine, debug).

local paint = xiao.paint
local red = paint.color.rgb(255, 0, 0)
local white = paint.color.rgb(255, 255, 255)
local black = paint.color.rgb(0, 0, 0)

paint.listener.add("hello", function(width, height)
    paint.circle.filled(paint.point.vector2(width / 2, height / 2), red, 60)
    paint.text.center(paint.point.vector2(width / 2, height / 2 - 8), "bonjour", white, black)
end)

Open the Lua tab, paste this script and press Execute: a red circle with bonjour appears in the middle of the screen. Clear VM removes it. See Running scripts for the editor, the console and the time limits.


Sandbox

Scripts cannot reach the disk or the system outside C:\xiaohook.

Removed Replacement
the whole io library xiao.fs
os.execute, os.exit, os.getenv, os.remove, os.rename, os.tmpname, os.setlocale none, os keeps clock, date, difftime, time
dofile, loadfile load(xiao.fs.read(path))
package.loadlib, package.seeall, native modules, package.path and package.cpath lookups require restricted to C:\xiaohook\lua
ffi none
binary chunks (bytecode) in load, loadstring and scripts text source only
debug.debug none

Game support

Game Version Status
Minecraft Bedrock (Windows) 1.26.6005.0 Supported