Eng:Blockmaking FAQs

Blockmaking is the practice of creating customized Scratch blocks, often for Scratch Modifications. This page lists FAQs about it.

How difficult is it?
The difficulty depends on what you are trying to do. You have blockspecs and methods. The blockspecs are what define the block itself. The methods tell the block what to do.

Do I need any other programs?
All you need is Scratch or the Source Code. However, if you are having trouble, Scramble is a good way of getting started. You need to program in Squeak. A good way to start with Squeak is with Squeak Tutorial on this Wiki.

Making a block
Squeak is sometimes hard to get the hang of, so you can get the code for some custom blocks at the Block Library. You will soon get the hang of it.

Navigating to Block Specs
Open the System Browser From the browser, go to:
 * Scratch-Objects
 * ScriptableScratchMorph
 * Click onto Class
 * block specs
 * blockSpecs

Adding the Block Spec
The block spec for each block is in brackets and uses the following structure:

Inputs are put the block text where desired. Each input has a  followed by a letter representing the input type.

List of inputs:


 * Attribute of another sprite, such as X position or size


 * A boolean insert


 * Color picker that shows the menu


 * Color picker that does not


 * The sprite direction menu/numerical insert


 * The menu for MIDI drums


 * The broadcast message menu


 * Math function menu (with sin, abs, etc.)


 * Menu for the different graphic effects


 * Numerical sensor board selector menu


 * Boolean sensor board selector menu


 * MIDI instrument menu/numerical insert


 * Menu for the names of the different keys


 * Menu with the costume names of the current sprite


 * List name menu


 * Sprite list


 * Numerical insert


 * Note name menu/insert


 * String insert


 * Sound selector menu


 * Variable menu


 * Menu in Delete of

List of identifiers:


 * Stack Block


 * Reporter Block


 * Boolean Block


 * C Block


 * Time block (such as Wait Secs)


 * 'When' Hat Block (obsolete)


 * When Green Flag Clicked block


 * When Key Pressed block


 * When I Receive block


 * Special form (hard to code)

For example, the blockspec for the repeat block is:

When you are done, right-click in the System Browser and click accept.

Adding the code
Click 'instance' (next to class). Then click the appropriate 'op'. Add the code and command for the block. Right click and click accept.

Saving the image
Close the system browser. You may now test your new block. When you are done Shift-Click-R and click 'Save image for end user'. This will save your changes to Scratch.