Compile an @minecraft/server script
validate_scriptCompiles a behavior pack script with the real TypeScript compiler against the actual @minecraft/server type definitions for that version. Returns diagnostics with line, column, TS error code and message, and reports which module versions it compiled against. Catch non-existent APIs and calls removed in later versions here — Bedrock scripting APIs written from memory are the most common source of output that fails silently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The complete script content. JavaScript or TypeScript. | |
| channel | No | Module channel. Defaults to stable. If beta is requested but a module has no beta release it falls back to stable — the modules field in the result says which version each module was compiled against. | |
| version | No | Game version under data/, e.g. 1.26.40 or 1.26.40.5. Defaults to the newest available version. Marketing numbers (26.40) are rejected. |