Warp & World Lookup
client:warp(name, special?)
| Field | Type |
|---|---|
| Signature | (self: Client, name: string, special: boolean?) → string? |
| Returns | string? — nil on Status.IN_WORLD, an Errors.* code otherwise |
| Common errors | Errors.WORLD_FULL, Errors.INVALID_WORLD, Errors.WORLD_NOT_FOUND, Errors.TIMEOUT, Errors.DISCONNECTED, Errors.TUTORIAL_BUSY |
| Async | yes |
special=true for instanced worlds (NETHER/MINES/MINEWORLD families). The "NAME:entryId" form joins via a specific portal entry point.
client:warp("MYWORLD")
client:warp("MYWORLD:portal-id")
client:warpRandom()
| Field | Type |
|---|---|
| Signature | (self: Client) → string? |
| Returns | string? — landed world name on success, nil on timeout (12 s) |
| Async | yes |
client:leave()
| Field | Type |
|---|---|
| Signature | (self: Client) → string? |
| Returns | string? — nil on success |
| Async | yes |
client:nether(level)
| Field | Type |
|---|---|
| Signature | (self: Client, level: number) → string? |
| Returns | string? — nil on success |
| Async | yes |
Joins the NETHER instanced world at the given level (0..4).
client:mines(level)
| Field | Type |
|---|---|
| Signature | (self: Client, level: number) → string? |
| Returns | string? — nil on success |
| Async | yes |
Joins the MINES instanced world at the given level (0..4).
client:enterPortal(point)
| Field | Type |
|---|---|
| Signature | (self: Client, point: Vec2i) → string? |
| Returns | string? — nil on success |
| Common errors | Errors.NOT_IN_WORLD, Errors.DISCONNECTED |
| Async | yes |
Steps through the portal at point. Cross-world portals route through warp_to_entry; same-world portals send GoFromPortal.
client:enterTutorial()
| Field | Type |
|---|---|
| Signature | (self: Client) → string? |
| Returns | string? — nil on success |
| Common errors | Errors.WORLD_NOT_FOUND, Errors.TIMEOUT, Errors.DISCONNECTED |
| Async | yes |
Drives the bootstrap join used for brand-new guest accounts that haven't completed the tutorial.
client:recentWorlds(timeoutMs?)
| Field | Type |
|---|---|
| Signature | (self: Client, timeoutMs: number?) → {string} |
| Returns | 1-indexed table of {name, id, count} rows. count may be a sentinel — see WorldCount |
| Async | yes |
client:activeWorlds(timeoutMs?)
| Field | Type |
|---|---|
| Signature | (self: Client, timeoutMs: number?) → {string} |
| Returns | 1-indexed table of {name, id, count} rows |
| Async | yes |
client:worldInfo(name, timeoutMs?)
| Field | Type |
|---|---|
| Signature | (self: Client, name: string, timeoutMs: number?) → { name: string, count: number } |
| Returns | One-shot lookup. count is one of the WorldCount.* sentinels OR a real online count (>= 0). nil on timeout |
| Async | yes |
Default timeout is 3000ms across the three lookups.
local recent = client:recentWorlds() -- last visited
local active = client:activeWorlds(5000) -- popular, custom timeout
local info = client:worldInfo("MYWORLD") -- one-shot lookup
for i, w in ipairs(recent) do
print("{} (id={}) — {} online", w.name, w.id, w.count)
end
if info.count >= 0 and info.count < 50 then
client:warp(info.name)
elseif info.count == WorldCount.doesNotExist then
print("world doesn't exist yet")
end
WorldCount.doesNotExist -- -3
WorldCount.instanced -- -1
World queries
client:isWalkable(point)
| Field | Type |
|---|---|
| Signature | (self: Client, point: Vec2i) → boolean |
| Returns | boolean — true when the foreground tile at point is air. false for OOB or when no world is loaded |
| Async | yes |
client:growingTileAt(point)
| Field | Type |
|---|---|
| Signature | (self: Client, point: Vec2i) → Tree? |
| Returns | Tree? — growing-tile metadata, or nil when nothing is growing |
| Async | yes |
client:worldItems()
| Field | Type |
|---|---|
| Signature | (self: Client) → {WorldItemRow} |
| Returns | 1-indexed table of {x, y, blockType, class, isOpen} rows. Empty when no world is loaded |
| Async | yes |
client:findWorldItems(opts?)
| Field | Type |
|---|---|
| Signature | (self: Client, opts: { class: string?, open: boolean? }?) → {WorldItemRow} |
| Returns | Filtered version of worldItems(). class is a case-insensitive substring match (e.g. "Door" catches WoodenDoorData). open filters by open/closed state. Either filter can be omitted |
| Async | yes |
client:portals()
| Field | Type |
|---|---|
| Signature | (self: Client) → {PortalRow} |
| Returns | 1-indexed table of {x, y, blockType, class, targetWorld, targetEntry, ownEntry, isOpen} rows |
| Async | yes |
client:dumpWorldTiles()
| Field | Type |
|---|---|
| Signature | (self: Client) → string? |
| Returns | string? — CSV dump of the foreground-tile grid; empty string when no world is loaded |
| Async | yes |
Useful for diagnosing stuck pathfinding from a script.
client:hasItem(blockId, min?)
| Field | Type |
|---|---|
| Signature | (self: Client, blockId: number, min: number?) → boolean |
| Returns | boolean — true when the bot holds at least min (default 1) of blockId |
| Async | yes |
client:isWalkable(Vector2i.new(5, 3))
client:growingTileAt(Vector2i.new(5, 3))
client:worldItems()
client:findWorldItems({ class = "Lock" })
client:portals()
client:dumpWorldTiles()
client:hasItem(blockId)
client:hasItem(blockId, 5)