Execute JavaScript in Blockbench
bb_execute_jsRun arbitrary async JavaScript inside Blockbench to access all globals, Node modules, and an injected api helper when structured tools cannot cover a task.
Instructions
Run arbitrary async JavaScript inside Blockbench with full access to every global (Project, Cube, Group, Mesh, Texture, Canvas, Codecs, Formats, Modes, Undo, Outliner, Preview, Menu, Action, BarItems, Plugins, StateMemory, ...) and the Node modules a plugin may use. Use this for anything the structured tools do not cover. The code may use await and must return a value; console output is captured and returned. An api argument is injected with helpers: api.find(ref), api.findAll(refs), api.textures(), api.animations(), api.sleep(ms), api.readFile(path), api.writeFile(path,text), api.toBase64(bytes), api.fromBase64(b64), api.toast(text).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript source. May use await. The value of the last expression / an explicit return is returned. |