Skip to main content

Warp & World Lookup

client:warp(name, special?)

FieldType
Signature(self: Client, name: string, special: boolean?) → string?
Returnsstring?nil on Status.IN_WORLD, an Errors.* code otherwise
Common errorsErrors.WORLD_FULL, Errors.INVALID_WORLD, Errors.WORLD_NOT_FOUND, Errors.TIMEOUT, Errors.DISCONNECTED, Errors.TUTORIAL_BUSY
Asyncyes

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()

FieldType
Signature(self: Client) → string?
Returnsstring? — landed world name on success, nil on timeout (12 s)
Asyncyes

client:leave()

FieldType
Signature(self: Client) → string?
Returnsstring?nil on success
Asyncyes

client:nether(level)

FieldType
Signature(self: Client, level: number) → string?
Returnsstring?nil on success
Asyncyes

Joins the NETHER instanced world at the given level (0..4).

client:mines(level)

FieldType
Signature(self: Client, level: number) → string?
Returnsstring?nil on success
Asyncyes

Joins the MINES instanced world at the given level (0..4).

client:enterPortal(point)

FieldType
Signature(self: Client, point: Vec2i) → string?
Returnsstring?nil on success
Common errorsErrors.NOT_IN_WORLD, Errors.DISCONNECTED
Asyncyes

Steps through the portal at point. Cross-world portals route through warp_to_entry; same-world portals send GoFromPortal.

client:enterTutorial()

FieldType
Signature(self: Client) → string?
Returnsstring?nil on success
Common errorsErrors.WORLD_NOT_FOUND, Errors.TIMEOUT, Errors.DISCONNECTED
Asyncyes

Drives the bootstrap join used for brand-new guest accounts that haven't completed the tutorial.

client:recentWorlds(timeoutMs?)

FieldType
Signature(self: Client, timeoutMs: number?) → {string}
Returns1-indexed table of {name, id, count} rows. count may be a sentinel — see WorldCount
Asyncyes

client:activeWorlds(timeoutMs?)

FieldType
Signature(self: Client, timeoutMs: number?) → {string}
Returns1-indexed table of {name, id, count} rows
Asyncyes

client:worldInfo(name, timeoutMs?)

FieldType
Signature(self: Client, name: string, timeoutMs: number?) → { name: string, count: number }
ReturnsOne-shot lookup. count is one of the WorldCount.* sentinels OR a real online count (>= 0). nil on timeout
Asyncyes

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)

FieldType
Signature(self: Client, point: Vec2i) → boolean
Returnsbooleantrue when the foreground tile at point is air. false for OOB or when no world is loaded
Asyncyes

client:growingTileAt(point)

FieldType
Signature(self: Client, point: Vec2i) → Tree?
ReturnsTree? — growing-tile metadata, or nil when nothing is growing
Asyncyes

client:worldItems()

FieldType
Signature(self: Client) → {WorldItemRow}
Returns1-indexed table of {x, y, blockType, class, isOpen} rows. Empty when no world is loaded
Asyncyes

client:findWorldItems(opts?)

FieldType
Signature(self: Client, opts: { class: string?, open: boolean? }?) → {WorldItemRow}
ReturnsFiltered 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
Asyncyes

client:portals()

FieldType
Signature(self: Client) → {PortalRow}
Returns1-indexed table of {x, y, blockType, class, targetWorld, targetEntry, ownEntry, isOpen} rows
Asyncyes

client:dumpWorldTiles()

FieldType
Signature(self: Client) → string?
Returnsstring? — CSV dump of the foreground-tile grid; empty string when no world is loaded
Asyncyes

Useful for diagnosing stuck pathfinding from a script.

client:hasItem(blockId, min?)

FieldType
Signature(self: Client, blockId: number, min: number?) → boolean
Returnsbooleantrue when the bot holds at least min (default 1) of blockId
Asyncyes
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)