Use scratch to create a custom block
Use Scratch to design and build a custom block (my block), add parameters, test it in projects, and reuse it to simplify code.

About this tutorial
Use Scratch to design and build a custom block (my block), add parameters, test it in projects, and reuse it to simplify code.
What you need
Step by step
- 1
Step 1
Open Scratch and create a new project so you have a fresh area to build in.
- 2
Step 2
Choose or paint a sprite to be the one that uses your custom block.
- 3
Step 3
Click the My Blocks category and then click Make a Block to start a new custom block.
- 4
Step 4
Type my block as the block name in the Make a Block dialog.
- 5
Step 5
Click the + button in the dialog to add at least one input parameter and give it a short name like n or color.
- 6
Step 6
Click OK to create the block and open the define my block area where you will add code.
- 7
Step 7
Drag the code blocks you want the custom block to do into the define my block area.
- 8
Step 8
Insert the parameter reporter into the define code wherever the value should change the block’s behavior.
- 9
Step 9
Drag the my block reporter into the Scripts area and set the parameter value to a test value.
- 10
Step 10
Click the green flag or run the script to test how my block works with your test value.
- 11
Step 11
Drag my block into other parts of your project where you had repeated code to simplify your scripts.
- 12
Step 12
Save your Scratch project to keep your new custom block and changes.
- 13
Step 13
Share your finished creation on DIY.org
Fun facts
How do I create a custom block (My Block) in Scratch and use it in a project?
Open your Scratch project, select a sprite, then open the “My Blocks” (or “More Blocks”) category and click “Make a Block.” Name it, add parameters (inputs) in the dialog, then build the block’s definition using the generated “define” block. Call your custom block from scripts to run the packed steps. Test by running the project, tweak the definition as needed, and use calls to simplify repeated code.
What materials and tools do I need to make a custom block in Scratch?
You need a computer, Chromebook, or tablet that runs Scratch (online at scratch.mit.edu or the offline editor), a mouse or touch input, and an internet connection for the online editor. A free Scratch account helps save projects. Optionally, a notepad for planning and adult supervision for younger children. No special hardware or paid software is required.
What ages is creating custom blocks in Scratch suitable for?
Creating custom blocks is generally suitable for children aged about 8 and up, when they can read and follow multi-step logic. Younger kids (5–7) can try this with hands-on adult guidance. Older children and teens benefit from custom blocks for learning abstraction and organizing larger projects. Adjust complexity and supervision to the child’s experience and attention span.
What are the benefits of using custom blocks in Scratch projects?
Custom blocks teach abstraction and reduce repeated code, making projects easier to read and debug. Parameters let kids experiment with inputs, building early function and variable concepts. Reuse of blocks speeds development, supports teamwork, and helps structure larger projects. Overall, making custom blocks strengthens computational thinking, problem decomposition, and neat project organization.
Watch & Learn
Need help?
What can I use if I can't access Scratch online or the Make a Block feature?
If you can't access the online editor or the 'Make a Block' button, install the Scratch 3.0 offline editor or simulate a custom block by creating a helper sprite that runs the repeated code when it receives a broadcast message, and upload an image from your computer instead of using the Paint Editor for the 'Choose or paint a sprite' step.
My custom block doesn't seem to do anything when I click the green flag—what should I check?
Check that you actually dragged code into the 'define my block' area, that you placed the 'my block' reporter into the Scripts area with a test parameter value, and that the script calling 'my block' is connected to a start block like the green flag or another event.
How can I adapt this custom block activity for different ages?
For younger kids use a single simple parameter like 'n' and let them drag basic motion or looks blocks into 'define my block', for middle grades add a color or number parameter and testing step, and for older kids require multiple parameters, loops, broadcasts or cloning inside 'define my block' and have them save and share the project on DIY.org.
How can we extend or personalize our custom block after making it?
Extend it by adding extra input parameters (for color, speed, or count), changing the sprite's costumes or adding sound blocks inside the 'define my block' code, reusing the custom block across multiple sprites to simplify scripts, and then save and share the finished project on DIY.org.