Minecraft Builder Skill
Overview
Create Minecraft builds by writing small JavaScript recipes that use Lodestone-backed helper functions. Export vanilla .nbt structure files, then open the included viewer so the user can inspect and iterate on the build.
Workflow
- Work from the installed skill directory. Do not rerun the Skills CLI after installation; use this skill's local
scripts/ and assets/.
- Before running any build or preview scripts, ensure dependencies are installed. If
node_modules/@mattzh72/lodestone is missing, run this from the installed skill directory:
npm install --omit=dev
- Write an ESM recipe file. Use
assets/examples/celestial-forge.mjs as the canonical example for ambitious floating megastructures.
- Generate NBT:
node scripts/run-build.mjs path/to/recipe.mjs --out-dir minecraft-builds/my-build
- Open the preview:
node scripts/preview.mjs --nbt minecraft-builds/my-build/my-build.nbt
- Iterate by editing the recipe, regenerating the
.nbt, and reopening or refreshing the preview.
Dependencies
Skills CLI installs copy the skill files but may not install Node packages. This skill intentionally keeps dependencies in package.json and npm-shrinkwrap.json instead of vendoring node_modules.
Before using scripts/run-build.mjs or scripts/preview.mjs, check for node_modules/@mattzh72/lodestone. If it is absent, run npm install --omit=dev from the installed skill directory. Do not install dependencies globally, and do not guess alternate Lodestone versions.
Recipe Contract
Export a default function that receives api and returns either a Lodestone Structure or an object with { structure, metadata }.
export default function build(api) {
const structure = api.createStructure([16, 12, 16])
api.fill(structure, [0, 0, 0], [15, 0, 15], 'minecraft:stone_bricks')
api.hollowBox(structure, [4, 1, 4], [11, 7, 11], 'minecraft:spruce_planks')
return { structure, metadata: { name: 'example-build' } }
}
Available helpers include createStructure, setBlock, fill, hollowBox, line, sphere, cylinder, normalizeBlock, createBlockNbt, and Lodestone classes under api.lodestone.
References
- For exact recipe helper signatures, supported option fields, defaults, and unsupported behavior, search
references/recipe-api.md.
- For Lodestone classes, structure NBT, block states, renderer APIs, resource pack APIs, supported fields, and unsupported behavior, search
references/lodestone/.
- For exact default-pack block ids, rendered block-state value enums, special renderer state values, and generic renderer properties like
waterlogged, search references/lodestone/default-pack-block-states.md.
- Prefer these local references over guessing. Use
rg for class names, method names, block-state properties, NBT tag names, and option fields before using advanced APIs.
Reference Lookup
- Before choosing nontrivial block-state values, search
references/lodestone/default-pack-block-states.md.
- For one block, print its exact section, for example
rg -n -A 80 '### `minecraft:oak_stairs`' references/lodestone/default-pack-block-states.md.
- For global property enums, search property-index lines, for example
rg -n '^- `shape`|^- `waterlogged`' references/lodestone/default-pack-block-states.md.
- Before relying on automatic connection behavior, search
references/lodestone/structure.md for updateBlockStates() and check the supported and unsupported coverage.
- When writing block entities or custom NBT, search
references/lodestone/nbt.md and references/recipe-api.md before constructing tags.
Build Guidance
- Keep all coordinates inside the structure size. The runner validates bounds and fails fast.
- Use vanilla block IDs with the
minecraft: namespace. Block-state strings like minecraft:oak_stairs[facing=east,half=bottom,shape=straight] are supported.
- The runner enables Lodestone's Minecraft-like block state updates by default. Panes, iron bars, and fences get
north/east/south/west states from neighboring compatible or solid blocks. Use --no-block-state-updates only when a recipe intentionally sets those states by hand.
- Prefer clear block palettes and readable geometry. The viewer uses Lodestone's bundled default resource pack, so highly unusual or custom blocks may not preview well.
- Include
metadata.name to control the output filename. Names are slugified.
- Default output is gzip-compressed vanilla structure NBT with
DataVersion set by the runner unless overridden.
- For block entities, pass a Lodestone
NbtCompound as the last argument to setBlock or use api.createBlockNbt({ id: 'minecraft:chest' }).
Preview
The preview script starts a minimal Vite server and opens the build automatically. It serves the target .nbt and Lodestone's default resource pack through local middleware, so recipes do not need to copy assets.
Use --no-open when running in a non-interactive environment:
node scripts/preview.mjs --nbt path/to/build.nbt --no-open
Open directly in night lighting when helpful for review:
node scripts/preview.mjs --nbt path/to/build.nbt --lighting night
1---2name: minecraft-builder-skill3description: Programmatically generate Minecraft builds as vanilla structure NBT files and open Lodestone-powered previews. Use when an agent needs to create, export, inspect, or iterate on Minecraft structures, schematics, block palettes, or build recipes using JavaScript and .nbt output.4---56# Minecraft Builder Skill78## Overview910Create Minecraft builds by writing small JavaScript recipes that use Lodestone-backed helper functions. Export vanilla `.nbt` structure files, then open the included viewer so the user can inspect and iterate on the build.1112## Workflow13141. Work from the installed skill directory. Do not rerun the Skills CLI after installation; use this skill's local `scripts/` and `assets/`.152. Before running any build or preview scripts, ensure dependencies are installed. If `node_modules/@mattzh72/lodestone` is missing, run this from the installed skill directory:1617```bash18npm install --omit=dev19```20213. Write an ESM recipe file. Use `assets/examples/celestial-forge.mjs` as the canonical example for ambitious floating megastructures.224. Generate NBT:2324```bash25node scripts/run-build.mjs path/to/recipe.mjs --out-dir minecraft-builds/my-build26```27285. Open the preview:2930```bash31node scripts/preview.mjs --nbt minecraft-builds/my-build/my-build.nbt32```33346. Iterate by editing the recipe, regenerating the `.nbt`, and reopening or refreshing the preview.3536## Dependencies3738Skills CLI installs copy the skill files but may not install Node packages. This skill intentionally keeps dependencies in `package.json` and `npm-shrinkwrap.json` instead of vendoring `node_modules`.3940Before using `scripts/run-build.mjs` or `scripts/preview.mjs`, check for `node_modules/@mattzh72/lodestone`. If it is absent, run `npm install --omit=dev` from the installed skill directory. Do not install dependencies globally, and do not guess alternate Lodestone versions.4142## Recipe Contract4344Export a default function that receives `api` and returns either a Lodestone `Structure` or an object with `{ structure, metadata }`.4546```js47export default function build(api) {48 const structure = api.createStructure([16, 12, 16])49 api.fill(structure, [0, 0, 0], [15, 0, 15], 'minecraft:stone_bricks')50 api.hollowBox(structure, [4, 1, 4], [11, 7, 11], 'minecraft:spruce_planks')51 return { structure, metadata: { name: 'example-build' } }52}53```5455Available helpers include `createStructure`, `setBlock`, `fill`, `hollowBox`, `line`, `sphere`, `cylinder`, `normalizeBlock`, `createBlockNbt`, and Lodestone classes under `api.lodestone`.5657## References5859- For exact recipe helper signatures, supported option fields, defaults, and unsupported behavior, search `references/recipe-api.md`.60- For Lodestone classes, structure NBT, block states, renderer APIs, resource pack APIs, supported fields, and unsupported behavior, search `references/lodestone/`.61- For exact default-pack block ids, rendered block-state value enums, special renderer state values, and generic renderer properties like `waterlogged`, search `references/lodestone/default-pack-block-states.md`.62- Prefer these local references over guessing. Use `rg` for class names, method names, block-state properties, NBT tag names, and option fields before using advanced APIs.6364## Reference Lookup6566- Before choosing nontrivial block-state values, search `references/lodestone/default-pack-block-states.md`.67- For one block, print its exact section, for example ``rg -n -A 80 '### `minecraft:oak_stairs`' references/lodestone/default-pack-block-states.md``.68- For global property enums, search property-index lines, for example ``rg -n '^- `shape`|^- `waterlogged`' references/lodestone/default-pack-block-states.md``.69- Before relying on automatic connection behavior, search `references/lodestone/structure.md` for `updateBlockStates()` and check the supported and unsupported coverage.70- When writing block entities or custom NBT, search `references/lodestone/nbt.md` and `references/recipe-api.md` before constructing tags.7172## Build Guidance7374- Keep all coordinates inside the structure size. The runner validates bounds and fails fast.75- Use vanilla block IDs with the `minecraft:` namespace. Block-state strings like `minecraft:oak_stairs[facing=east,half=bottom,shape=straight]` are supported.76- The runner enables Lodestone's Minecraft-like block state updates by default. Panes, iron bars, and fences get `north/east/south/west` states from neighboring compatible or solid blocks. Use `--no-block-state-updates` only when a recipe intentionally sets those states by hand.77- Prefer clear block palettes and readable geometry. The viewer uses Lodestone's bundled default resource pack, so highly unusual or custom blocks may not preview well.78- Include `metadata.name` to control the output filename. Names are slugified.79- Default output is gzip-compressed vanilla structure NBT with `DataVersion` set by the runner unless overridden.80- For block entities, pass a Lodestone `NbtCompound` as the last argument to `setBlock` or use `api.createBlockNbt({ id: 'minecraft:chest' })`.8182## Preview8384The preview script starts a minimal Vite server and opens the build automatically. It serves the target `.nbt` and Lodestone's default resource pack through local middleware, so recipes do not need to copy assets.8586Use `--no-open` when running in a non-interactive environment:8788```bash89node scripts/preview.mjs --nbt path/to/build.nbt --no-open90```9192Open directly in night lighting when helpful for review:9394```bash95node scripts/preview.mjs --nbt path/to/build.nbt --lighting night96```