Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to use the "My blocks" feature?
- Advantage_coding
-
90 posts
How to use the "My blocks" feature?
I want to know how to use the “My blocks” feature? I feel like it could really help me, but I just don't know how!
Any help appreciated al lot





Any help appreciated al lot






- DifferentDance8
-
1000+ posts
How to use the "My blocks" feature?
Thanks for asking! I want to know how to use the “My blocks” feature? I feel like it could really help me, but I just don't know how!
Any help appreciated al lot
The my blocks section is essentially a category where you decide (for your project) what blocks exactly do you want to put there. It's like a sandbox but for scratch.
As an example, say you wanted to make a project. In this project, you would want your player to jump.
You could do:
But that takes up space, so you can just package it in a block (in this example, called “jump”)
And then do this to let your player jump:
And that is essentially it for now.
- Advantage_coding
-
90 posts
How to use the "My blocks" feature?
Thank you so much! I have a way better understanding now 

- deck26
-
1000+ posts
How to use the "My blocks" feature?
https://en.scratch-wiki.info/wiki/My_Blocks
As well as tidying up code and making it more readable custom blocks have advantages.
- a custom block called by a sprite or clone is only run by that sprite/clone whereas all clones will act on a broadcast which would be another way to split code
- you can use the ‘no screen refresh’ option for speed
- you can pass parameters so eg you can draw a circle at a specified location and a specified size just by entering the correct values in a the custom block call
As well as tidying up code and making it more readable custom blocks have advantages.
- a custom block called by a sprite or clone is only run by that sprite/clone whereas all clones will act on a broadcast which would be another way to split code
- you can use the ‘no screen refresh’ option for speed
- you can pass parameters so eg you can draw a circle at a specified location and a specified size just by entering the correct values in a the custom block call
- Advantage_coding
-
90 posts
How to use the "My blocks" feature?
what do you mean by ‘no screen refresh’?

- RT_Borg
-
1000+ posts
How to use the "My blocks" feature?
Hi Advantage_coding, what do you mean by ‘no screen refresh’?
Many of the blocks in scratch cause a script to pause for 1/30 of a second to redraw. For example, if you do a series of moves or costume changes, you typically want to see each change on the screen before then next one.
But sometimes you want to do a lot of operations all at once, without slowing down or having the player see. An example would be testing whether a moving sprite is colliding with a wall, so it can change directions. You might move forward, test and discover you're now touching (inside) the wall, and then quickly undo the move (move back in the opposite direction). You don't want the player to see that test and maybe back out of a collision, so you'd want to do it “without screen refresh.”
When you make a custom block, there's a checkbox where you can choose “without screen refresh” for the block.
– RT_Borg
Last edited by RT_Borg (Sept. 2, 2022 08:02:24)
- KaaBEL_sk
-
100+ posts
How to use the "My blocks" feature?
I would also mention advantage of using stop this script in my blocks.
Sometimes a script inside loop requires to stop before the end of loop, but cotinue other code. Or it can be used as end the loop instead of puting more conditions in repeat until, there can be anywhere in the script if with stop this script.
I also use my blocks for comments (as I saw somewhere else). Those are composed in the sript, and stay even after backpacking the script.
Sometimes a script inside loop requires to stop before the end of loop, but cotinue other code. Or it can be used as end the loop instead of puting more conditions in repeat until, there can be anywhere in the script if with stop this script.
I also use my blocks for comments (as I saw somewhere else). Those are composed in the sript, and stay even after backpacking the script.
- isaacxcode
-
2 posts
How to use the "My blocks" feature?
I want to know how to use the “My blocks” feature? I feel like it could really help me, but I just don't know how!
Any help appreciated al lot
To make it simple, when you make a block you get two things:
and in the my blocks section you will see another block.
Now, the block that you see in the my blocks section, is what will trigger what is inside of the Define “Your block name”
For example, in the Define block, if I were to put in a change x by 10
So basically what this does is "When the flag Is clicked, forever, trigger your block. Inside of the block is a change x by 10. So you will forever change x by 10.
Last edited by isaacxcode (April 7, 2024 15:26:46)
- MineTurte
-
1000+ posts
How to use the "My blocks" feature?
Please don't necropost; especially when it already seems as if this topic was resolved. Thanks!I want to know how to use the “My blocks” feature? I feel like it could really help me, but I just don't know how!
Any help appreciated al lot
To make it simple, when you make a block you get two things:
and in the my blocks section you will see another block.
Now, the block that you see in the my blocks section, is what will trigger what is inside of the Define “Your block name”
For example, in the Define block, if I were to put in a change x by 10
So basically what this does is "When the flag Is clicked, forever, trigger your block. Inside of the block is a change x by 10. So you will forever change x by 10.
Necroposting is when you post on an old topic either not adding anything or adding irrelevant information. In your case you were just saying what was already said.
Last edited by MineTurte (April 7, 2024 15:30:13)
- wajidtheghost7
-
2 posts
How to use the "My blocks" feature?
there are 3 options in the my blocks window the add an input (number or text) and add an input (boolean) and add a label there is also a run without screen refresh option 

- TheNoisyNoisy
-
100+ posts
How to use the "My blocks" feature?
just so you know boolean is barely ever used lol
- LukaTang
-
3 posts
How to use the "My blocks" feature?
hi, @Advantage_coding , I want to know how to use the “My blocks” feature? I feel like it could really help me, but I just don't know how!
Any help appreciated al lot
my blocks are created by yourself, when you created it, it usually pops up a define block
for example:
you can change what is in the blank space above by typing in the block(editing block mode)
a simple understanding of my blocks is when the green flag is clicked, the code starts running, but when it runs to the one of the my blocks, it will find the define block, and do what is in the define block. But when the define block's code is finished, it goes back to the main script where the my block is, and continues what is under
example code:
at the end, the sprite will say “hi”
From: @LukaTang you can ask me on my profile if needed in the future
- Discussion Forums
- » Help with Scripts
-
» How to use the "My blocks" feature?