Validate an automation script
validate_pythonValidates a Python automation script that runs OUTSIDE the game, on three axes: Python syntax (using the real interpreter), Minecraft commands embedded in the script (against the official command index), and the shape of the /connect WebSocket message envelope. For behavior pack scripts use validate_script instead — Python does not run inside a pack. The embedded command check is the most valuable one: a command written from memory can look syntactically fine and still do nothing in the game. Only strings starting with / are treated as commands. If syntax could not be checked, syntaxChecked is false in the result; ok:true alone does not mean the syntax is valid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The complete Python script content. | |
| 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. |