Get block schema
get_block_schemaRetrieve the full block schema for any Scratch opcode, including inputs, fields, dropdown options, shadow encoding, and a ready-to-adapt example, enabling correct block creation with patch_target.
Instructions
The full schema for one block opcode: its shape, every input (with the sb3 shadow encoding to use, e.g. a text input is [1, [10, "hi"]]), every field (with enumerated dropdown options where applicable), and a ready-to-adapt example block JSON. Read this before writing a block with patch_target. In the example, <…> placeholders (block ids, variable ids) must be replaced with real ones; menu inputs also need a matching shadow block (opcode menuOpcode, a field named menuField, shadow: true). Dynamic menu options (sprites, sounds, costumes, …) are filled from the open project; pass target to enumerate that sprite's own costumes and sounds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| opcode | Yes | A block opcode, e.g. "looks_say" or "control_if". | |
| target | No | Sprite name (or "Stage") whose costumes/sounds should populate dynamic menus. |