This page as Markdown: https://bloxd.io/docs/how-to-project-schematics.md. Every page of these docs, for AI agents: https://bloxd.io/docs/llms.txt

Project schematics

In the Code Editor, click the + beside Schematics, enter a project path, then upload a .bloxdschem file or choose a snapshot from your profile. A project can contain up to five schematics. Open an existing schematic to rename or delete it. To replace it, delete it and add it again at the same path. Profile edits do not change an existing snapshot.

Call api.setChunkAsSchematic(schematicPath, srcCoords, destCoords) to replace one complete destination chunk, including air and block data. Both positions are block coordinates selecting their containing chunk, like copyChunk. Source coordinates use the stored chunk grid, including padding around the original selection; the Code Editor shows its dimensions.

// Place two neighbouring chunks, spreading the work over ticks.
let nextChunk = 0
tick = () => {
    if (nextChunk < 2) {
        api.setChunkAsSchematic("maps/arena.bloxdschem", [nextChunk * 32, 0, 0], [nextChunk * 32, 64, 0])
        nextChunk++
    }
}

The example requires an arena containing source chunks [0, 0, 0] and [32, 0, 0]. Placement uses the normal chunk-load and block-data budgets, so spread larger builds over time. Missing assets or source chunks throw an error. Placement replaces chunks without block-break drops or callbacks.

Use api.getSchematicDimensions("maps/arena.bloxdschem") to get its stored [x, y, z] dimensions, including selection padding. Like placement, this reads the active project snapshot.

The @plugins/sessionBasedGame plugin accepts source: { schematic: "maps/arena.bloxdschem" } for maps and the lobby, alongside source: { rect: [pos1, pos2] }. Dimensions are read automatically and rounded outwards to chunks when checking the play area. Spawn positions and team pads use offsets from the stored chunk grid's lowest corner. Schematics are pasted directly through the plugin's normal map-loading flow and must fit within the available placement and block-data budgets; large metadata-heavy maps need a custom loader that spreads work over ticks.

Loading an entire schematic

function loadSchematic(schematicPath, destination) {
    const [width, height, depth] = api.getSchematicDimensions(schematicPath)
    const [destX, destY, destZ] = destination

    for (let x = 0; x < width; x += 32) {
        for (let y = 0; y < height; y += 32) {
            for (let z = 0; z < depth; z += 32) {
                api.setChunkAsSchematic(
                    schematicPath,
                    [x, y, z],
                    [destX + x, destY + y, destZ + z],
                )
            }
        }
    }
}

loadSchematic("maps/arena.bloxdschem", [0, 64, 0])
Logo