Skip to main content

getChunk

Fetches one chunk (its base64 voxel grid, per-voxel states, chunk state and LODs) by app id and chunk coordinates. voxelStates holds the states stored with the chunk and every voxel edit recorded for it (the voxel_updates log: updateVoxel, sendVoxelUpdate and a hub's or mod's world.set_voxels), each with its voxel type; voxels is the grid as last written by updateChunk, so apply each entry's voxelType over it. Returns null if the chunk does not exist. Use the input's LOD options to limit which LODs come back. Requires a valid bearer token in the Authorization header; a token scoped to an app may only read that app's chunks. Read-only (no world state is changed).

getChunk(
input: GetChunkInput!
): Chunk

Arguments​

getChunk.input ● GetChunkInput! non-null input​

Type​

Chunk object​

A persisted chunk of an app's voxel world. Holds an optional packed voxel-type grid for 16x16x16 chunks (voxels, one byte per voxel), sparse per-voxel state overrides and recorded edits (voxelStates; voxel positions and types are app-defined signed 16-bit values, so an app may address its chunks however it likes), an optional opaque chunk-level state blob (chunkState), and level-of-detail meshes (lods). Returned by getChunk/getChunksByDistance and written by updateChunk/updateChunkState/updateChunkLods.