Patch target JSON
patch_targetApply an RFC 6902 JSON Patch to any sprite's raw JSON to edit blocks or fields not covered by higher-level tools. Reads the target JSON first, applies the patch atomically, and reports warnings for unknown opcodes.
Instructions
Apply an RFC 6902 JSON Patch to a target's raw JSON — the way to edit a sprite's scripts (blocks) or any field a higher-level tool does not cover, on a sprite you just made or an existing one. Paths are JSON Pointers into the object returned by get_target_json; read that first. To write blocks, discover opcodes with list_blocks and get the exact input/field shapes from get_block_schema — the result reports advisory warnings for unknown opcodes or inputs. The patch is applied atomically: if any operation fails the target is left unchanged. Notes: patching the costumes/sounds arrays does not touch stored asset bytes (use add_costume/remove_costume for those), and you are responsible for keeping blocks internally consistent (ids, next/parent links).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Sprite name, or "Stage". | |
| patch | Yes | A JSON Patch document (array of operations). |