WorldEdit AI: let your assistant write CraftScripts
Updated
WorldEdit can run scripts, called CraftScripts, that place blocks through its API. Herobrain gives your AI assistant a place to run them: the assistant writes the CraftScript, Herobrain executes it on a headless WorldEdit 7 service in a sandbox, and sends back renders, cross-sections and a .schem file. You never paste code into your server.
What is a CraftScript?
A CraftScript is a JavaScript file that WorldEdit runs with access to an edit session: it can set blocks, fill regions, draw shapes and use patterns and masks. Hand-writing one is slow, which is why few players use them. An AI assistant writes them quickly, and Herobrain adds helper functions for the common jobs: roofs, spiral stairs, wall depth, furnished rooms, terrain, lakes and rivers, mirroring and radial copies.
A short excerpt of the kind of script an assistant writes:
// Round tower: stone brick walls, a spruce cone roof and a walkable spiral stair inside
makeCylinder(0, 0, 0, "stone_bricks", 5, 18, true);
makeCone(0, 18, 0, "spruce_planks", 7, 8);
spiralStair(0, 0, 1, 17, { r: 3, material: "spruce_stairs" });
Scripts use the Rhino JavaScript engine, so they are written in older JavaScript (var, no
arrow functions). Your assistant gets the rules and the API reference through Herobrain's docs.
Why run it through Herobrain instead of in-game?
- The assistant sees its result. Every run returns renders, and it can ask for top views, interior views and horizontal or vertical cross-sections to check floors and rooms.
- Nothing touches your world until you choose. You paste the .schem yourself, or send it to your Paper server with the Herobrain plugin.
- Edits are incremental. The assistant edits the saved script and reruns it, so the same build improves instead of starting over.
- Runs are reproducible. Random choices are seeded: the same script and parameters build the same blocks, which also powers the parameter sliders.
What are the limits and safeguards?
- Sandbox: an allowlist of Java classes, no network, no file system, a memory watchdog.
- Run time: 30 seconds by default, up to 120 seconds.
- Size: up to 1,024 blocks on any side and 16,777,216 blocks of volume.
- Daily limits per account during the beta, for example 60 new builds and 150 edits every 24 hours.
Parametric builds made from scripts
Each of these is one script with parameters. Open one to see the variations it generates.
Steampunk Blast Furnace
Japanese Castle with Cherry Blossoms
Life-Size Eiffel Tower
Elven Tree House Village
Greek Temple on a Hill
Floating Sky Island with Waterfall
For the tool list and the server URL, see the Minecraft MCP server page; for a walk-through with Claude, the Claude guide.
Questions
- Can AI write WorldEdit CraftScripts?
- Yes. With Herobrain connected, your AI assistant writes CraftScripts (JavaScript that calls the WorldEdit API) and Herobrain runs them on a headless WorldEdit service, returning renders and a .schem file.
- Do I need WorldEdit installed to build?
- Not to build: scripts run on Herobrain's server. You need WorldEdit (or the Herobrain plugin on a Paper server) only to paste the finished .schem into your world.
- Which WorldEdit version does it use?
- WorldEdit 7.4 with the Minecraft 1.21.11 block list. Scripts use the WorldEdit 7 API plus Herobrain's helper functions.
- Is running the scripts safe?
- Scripts run in a sandbox: Java classes are allowlisted, there is no network or file access, and there are time, memory and size limits. In your browser, the editor's preview runtime has no network access either.
- Can I read or edit the script?
- Yes, your own. Your assistant can show a saved script with line numbers and edit it, and the build updates in place. Scripts are private to their author.