XiaoHook.cc Lua API
The XiaoHook.cc Lua API lets you extend the client with your own scripts. A script is plain Lua text that you paste in the Lua tab and run with one button. It can draw an overlay, read the player and the world, listen to game events and read, edit, block or send network packets.
Write your first script xiaohook.cc Discord
What a script can do
Quick start
Every custom API lives under the global xiao table: xiao.paint, xiao.game, xiao.signal, xiao.packet,
xiao.config, xiao.fs, xiao.json, xiao.timer, xiao.workspace, xiao.notify. The standard Lua libraries keep
their usual global names.
local paint = xiao.paint
local gold = paint.color.hex("#F0C250")
local black = paint.color.rgb(0, 0, 0)
paint.add("hello", function(width, height)
local me = xiao.game.player()
if me == nil then return end
local line = ("hp %.0f %s"):format(me.health or 0, me.dimension_name or "?")
paint.text.left(paint.point.vector2(20, 20), line, gold, black)
end)
Open the Lua tab, paste the script and press Execute: your health and dimension are written in the top left corner of the screen once you are in a world. Clear VM removes it.
local paint = xiao.paint is only a shortcut: paint.text.left and xiao.paint.text.left are the same function. The
shortcut saves table lookups on every call.
What's new 2026-11-05
-
New
xiao.timer:after,every,cancel, andspawnwithwaitfor sequential code, on the frame clock. -
New
xiao.jsonencodes and decodes JSON, andxiao.workspacekeeps a table per name inC:\xiaohook\lua\workspace, saved on Clear VM. -
New
xiao.notify(title, text, kind)shows a toast of the client menu. -
New
xiao.cmd, the BedrockCreateMove: change the angles, the movement and the input buttons of every tick, before the client simulates it (createmove) or in the packet the server receives (authinput). -
New
xiao.configreads and changes every client setting by key (misc.hit_sound.volume), and loads, saves and lists configs. -
New Packet log: Copy as Lua now writes readable code with named variables and enums, and Copy as receiver copies a ready to use receiver.
-
New Packet fields:
msg:fields()andxiao.packet.fieldsreturn a packet as a Lua table, andsend_fields,encodeandwriter:fieldswrite it back. -
New
xiao.packet.hookintercepts packets: cancel, replace or edit them while they pass, with a 2 ms budget andhook_stats(). -
New Send queue: guaranteed send order,
pending()andcapacity(). -
New Signals
chat,entity_add,entity_remove,damageandworld_change. -
New
xiao.game.player(),world(),hotbar(),inventory(),armor(),offhand(),held_item(),selected_slot(),block(x, y, z)and richer entities (type,is_player,distance). -
New Copy and paste in the editor no longer block the game.
The full list is in the Changelog.
Where to go next
Engine
base, bit, coroutine, debug, fs, json, math, notify, os, paint, signal, string, table, timer, workspace.
Minecraft Bedrock
Guides
First script, Overlay, Events, Player and world, Reading packets, Sending packets, Modifying packets, Sandbox, Running scripts (including the execution contexts table), Changelog.