From Test-Scratch-Wiki
![]() |
This article or section may not have content matching Scratch Wiki editing standards. Please improve it according to Scratch Wiki:Guidelines. |
Hidden blocks are blocks that exist in Scratch, but are not shown in the Block Palette in the Scratch User Interface. They can be inserted into Scratch projects by editing the project file.
Hidden blocks can be added by downloading a project, changing the file extension from .sb3
to .zip
(Scratch project files are actually zipped folders, but if the file extension is left the same most file managers will not have an option to extract the files), and extracting the folder. This will result in a folder containing .svg
and .wav
files for the costumes and sounds, respectively; it will also contain a file named project.json
. Open this in a text editor like Notepad; the file format is described in Scratch File Format.
To find hidden blocks, go to https://github.com/LLK/scratch-vm/tree/develop/src/blocks and click on one of the categories; there will be a function called getPrimitives
. This returns an object with the opcodes for each block and the functions each one calls. If you make a block with one of these opcodes in the .json
file, it should appear when you zip all the files (not the folder they are contained in; only zip the files) and change the file extension to .sb3
(in Windows' File Explorer, files are shown without a file extension by default, so you may have to enable file extensions on the View tab), and loading it in Scratch. It is also possible to load the .zip
file without renaming it by choosing "All files" in the file type menu when loading the project.
Motion
Scroll Right () and Scroll Up ()
scroll right (10) :: motion scroll up (10) :: motion
- Main article: Scrolling (Stage)
Opcodes: motion_scroll_right, motion_scroll_up
These blocks do not do anything. In 2.0 alpha, these blocks would scroll the backdrop horizontally and vertically.
Align Scene ()
Align Scene () | |
align scene [bottom-left v] :: motion
| |
Type | Stack |
- Main article: Align Scene () (block)
Opcode: motion_align_scene
This block does not do anything. The drop down has the following options:
- bottom-left
- bottom-right
- middle
- top-left
- top-right
In 2.0 alpha, this block would align the backdrop to the selected position.
Scroll Position
(scroll x :: motion) (scroll y :: motion)
Opcodes: motion_xscroll, motion_yscroll
These reporter blocks do not return a result. Clicking on them will show no pop-up box at all, but they otherwise function as the string "undefined".
Looks
Hide All Sprites
Hide All Sprites | |
hide all sprites :: looks
| |
Type | Stack |
- Main article: Hide All Sprites (block)
Opcode: looks_hideallsprites
This block does not do anything. In 2.0 alpha, this block would hide all currently visible sprites.
Stretch
set stretch to (100) % :: looks change stretch by (10) :: looks
- Main article: Set Stretch to () (block)
- Main article: Change Stretch by () (block)
Opcodes: looks_setstretchto, looks_changestretchby
These two blocks do not do anything either. In Scratch 1.x, these blocks would do as their names imply.
Events
When this Sprite Touches ()
when this sprite touches (mouse-pointer v)::events hat ([mouse-pointer v] :: events)
Opcodes: event_whentouchingobject, event_touchingobjectmenu
This hat block activates when the sprite comes into contact with the selected object. The dropdown menu is the same as in the <touching (mouse-pointer v)?>
block. The second block is used internally as an input to the first one.
Control
For Each () in ()
For Each () in () | |
for each [variable v] in (10) {
| |
Type | C |
Opcodes: control_for_each
The variable selected using the dropdown is set to 1, and increases on each iteration of the script inside the loop, until it reaches the specified end point. (For example, in the above example, the script inside would be executed 10 times, with the variable ranging from 1 to 10.)
While ()
While () | |
while <> {
| |
Type | C |
Opcode: control_while
This is essentially the opposite of the repeat until block. The script inside the loop is executed until the Boolean is false.
Counter
(counter :: control) increment counter :: control clear counter :: control
Opcodes: control_get_counter, control_incr_counter, control_clear_counter
These blocks are pretty self-explanatory. (counter :: control)
returns the state of the counter, increment counter :: control
increments the counter by 1, and clear counter :: control
sets it to 0.
All at Once
All at Once | |
all at once {
| |
Type | C |
- Main article: All at Once (block)
Opcode: control_all_at_once
This C block has no effect. It was added for backwards compatibility, similar to the scroll blocks. In early versions of Scratch 2.0, this block was visible, and functioned similarly to the "run without screen refresh" option in custom blocks.
Sensing
Loud?
Loud? | |
<loud? :: sensing>
| |
Type | Boolean |
- Main article: Loud? (block)
Opcode: sensing_loud
In Scratch 3.0, returns true if <(loudness) > (10)>
, and returns false otherwise.
In previous versions of Scratch, it returned true only if <(loudness) > (30)>
.
User ID
User ID | |
(user id :: sensing)
| |
Type | Reporter |
- Main article: User ID (block)
Opcode: sensing_userid
Does not return a value, similar to the (scroll x :: motion)
and (scroll y:: motion)
blocks. In 2.0 alpha, this block returned a number unique to the viewer of the project.
List of internal reporters
Due to a limitation in the Blockly engine, many reporters exist for the sole purpose of adding inputs to other blocks.[1] Though these are technically used and available in the palette, they cannot normally be observed independent of their parent blocks.
Go to menu | |
([random position v] :: motion)
|
Opcode: motion_goto_menu
The dropdown menu is a list of sprites in the project. If "random position" is selected, returns "_random_", otherwise it behaves the same as the point towards menu. Used internally as an input to go to ( v)
.
Same as the go to menu. Used internally as an input to glide () secs to ( v)
.
Point towards menu | |
([mouse-pointer v] :: motion)
|
Opcode: motion_pointtowards_menu
The dropdown menu is a list of sprites in the project. If "mouse-pointer" is selected in the menu, returns "_mouse_", otherwise returns the name of the selected sprite. Used internally as an input to point towards ( v)
.
Backdrop menu | |
([backdrop1 v] :: looks)
|
Opcode: looks_backdrops
The dropdown is a list of backdrops in the Stage. Returns the name of the selected backdrop. Used internally as an input to switch backdrop to ( v)
.
Costume menu | |
([costume1 v] :: looks)
|
Opcode: looks_costume
The dropdown is a list of costumes in the current sprite. Returns the name of the selected costume. Used internally as an input to switch costume to ( v)
.
Sound menu | |
([Meow v] :: sound)
|
Opcode: sound_sounds_menu
Drop down is a list of all sounds in the sprite. Returns the name of the sound selected in the menu. Used internally by Scratch as an input to some blocks, such as start sound ( v)
.
Of note is that functionality for blocks with the opcodes sound_beats_menu
and sound_effects_menu
also exist in the source code, but the blocks themselves do not. According to the source code, they would act similar to the existing block, returning only the name of the selected effect and beat.
Broadcast menu | |
([message1 v] :: events)
|
Opcode: event_broadcast_menu
The dropdown is a list of broadcasts in the project. Returns the name of the selected broadcast. Used internally as an input to broadcast ( v)
.
Create Clone of () menu | |
([myself v] :: control)
|
Opcode: control_create_clone_of_menu
The dropdown is a list of sprites. Returns the value selected in the dropdown, or "_myself_" if it is "myself". Used internally as an input to create clone of ( v)
.
Distance menu | |
([mouse-pointer v] :: sensing)
|
The dropdown menu is a list of sprites. Returns "_mouse_" if "mouse-pointer" is selected in the menu, otherwise returns the selected sprite. Used internally as an input to (distance to ( v))
.
Key menu | |
([space v] :: sensing)
|
The dropdown menu is a list of keys. Returns the English name of the selected key. Used internally as an input to <key ( v) pressed?>
.
Object menu | |
([space v] :: sensing)
|
The dropdown menu is a list of sprites and the stage. Returns the name of the selected sprite or "_stage_" if the stage is selected. Used internally as an input to ([ v] of ( v))
.
Touching menu | |
([edge v] :: sensing)
|
The dropdown menu is a list of sprites. Returns "_edge_" or "_mouse_" for the special values "edge" and "mouse-pointer", otherwise returns the sprite selected in the menu. Used internally as an input to <touching ( v)>
.