Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Creating extensions for Scratch 3.0
- WPScratcher007
-
37 posts
Creating extensions for Scratch 3.0
exactly know how to create new extensions in Scratch. Do you sort of "hack" Scratch?? I don't know
- SimpleScratch
-
500+ posts
Creating extensions for Scratch 3.0
Yes.
Sheep_maker makes it possible to write extensions but you have to run them via their site and they can't be loaded on the normal Scratch site
I've sucessfully hacked the downloadable Scratch 3 versions but its a right pain in the neck to do so!
At the moment we can't just create extensions and submit them to Scratch team for approval and I personally doubt that we'll ever be able to do this( for at least the next few years)
Sheep_maker makes it possible to write extensions but you have to run them via their site and they can't be loaded on the normal Scratch site
I've sucessfully hacked the downloadable Scratch 3 versions but its a right pain in the neck to do so!
At the moment we can't just create extensions and submit them to Scratch team for approval and I personally doubt that we'll ever be able to do this( for at least the next few years)
Last edited by SimpleScratch (May 19, 2020 12:56:59)
- LostLittleChick738
-
500+ posts
Creating extensions for Scratch 3.0
There could be blocks from Snap.
- LostLittleChick738
-
500+ posts
Creating extensions for Scratch 3.0
Did you mean how about these for scratch it's the compassion without the extention and with
if keys <space:: events> <up:: events> <down:: events> <left:: events> pressed then:: events hat?
dance (cause it works:: sensing):: motion
when gf clicked
if <<key [space v] pressed?> or <<key [up arrow v] pressed?> or <<key [down arrow v] pressed?> or <key [left arrow v] pressed?>>>> then
dance (cause it works:: sensing):: motion
end
- LostLittleChick738
-
500+ posts
Creating extensions for Scratch 3.0
Yes.
Sheep_maker makes it possible to write extensions but you have to run them via their site and they can't be loaded on the normal Scratch site
I've sucessfully hacked the downloadable Scratch 3 versions but its a right pain in the neck to do so!
At the moment we can't just create extensions and submit them to Scratch team for approval and I personally doubt that we'll ever be able to do this( for at least the next few years)
when @greenFlag <when @greenFlag <when @greenFlag <when gf clicked:: hat>:: events hat>:: events hat>:: events hat
((((How)) + ((((do)) + <(know)> (all of(this?):: #FF00FF)>))(((How) + (join [? ] [How]):: extension (do (you):: custom) ((that) - (?)):: #ADD8E6):: #00FFFF):: #1b03a3 stack
say (((HOW) + ((DO) + (join [YOU] (join [KNOW] <[THIS]> [?]>:: operators))))
[freak out v]:: motion cap
Last edited by LostLittleChick738 (May 19, 2020 18:32:43)
- LostLittleChick738
-
500+ posts
Creating extensions for Scratch 3.0
But I can't hack ‘cause I don’t know how to. Do you just inspect (Ctrl + Shift + I)? Yes.
Sheep_maker makes it possible to write extensions but you have to run them via their site and they can't be loaded on the normal Scratch site
I've successfully hacked the downloadable Scratch 3 versions but its a right pain in the neck to do so!
At the moment we can't just create extensions and submit them to Scratch team for approval and I personally doubt that we'll ever be able to do this( for at least the next few years)

- rioi123
-
18 posts
Creating extensions for Scratch 3.0
how to use the extension?
I mean where to paste them or something
I mean where to paste them or something
go to [??? v]
- Darsh1994
-
14 posts
Creating extensions for Scratch 3.0
Hi, thanks for the great explanation. Can someone please tell me how can I add "on green flag clicked event“ for particular ”hat" type block in extension? I want to execute some part of code when “PROJECT_RUN_START” event triggered. right now this event is triggered by scratch native event block only.
Last edited by Darsh1994 (May 22, 2020 11:15:32)
- Jonathan50
-
1000+ posts
Creating extensions for Scratch 3.0
exactly know how to create new extensions in Scratch. Do you sort of "hack" Scratch?I don't know
This topic explains how to make Scratch extensions, but you'll want to understand the I want to create Scratch extensions, but I have no experience with Java. How do I create an extension w/out Java? JavaScript programming language first. (JavaScript isn't the same as Java.)
Last edited by Jonathan50 (May 22, 2020 23:22:16)
- TUX_OS
-
500+ posts
Creating extensions for Scratch 3.0
Nice I Am developer I use Blockly! But when I turn it into scratchblock that make wrong
- TUX_OS
-
500+ posts
Creating extensions for Scratch 3.0
when green flag clicked :: extension
say [LOL black blocks!] for (2 :: extension) secs :: extension
They are extensions :: extension cap
- TheGeniusCoder
-
100+ posts
Creating extensions for Scratch 3.0
wanna link the hacked downloadable version? or show it off with screenshots Yes.
Sheep_maker makes it possible to write extensions but you have to run them via their site and they can't be loaded on the normal Scratch site
I've sucessfully hacked the downloadable Scratch 3 versions but its a right pain in the neck to do so!
At the moment we can't just create extensions and submit them to Scratch team for approval and I personally doubt that we'll ever be able to do this( for at least the next few years)
- SimpleScratch
-
500+ posts
Creating extensions for Scratch 3.0
This is my original blog - I've haven't updated it/tried it since late 2019
http://simplesi.net/s3gpioalpha/
The comments explain the process
http://simplesi.net/s3gpioalpha/
The comments explain the process
- PiglinZumbi
-
17 posts
Creating extensions for Scratch 3.0
.
Last edited by PiglinZumbi (July 1, 2020 03:00:47)
- PiglinZumbi
-
17 posts
Creating extensions for Scratch 3.0
when I receive [simple make in this site: v]
think [:D] for (2) secs
if <(answer) = [But only for 18 years old or more]> then
say [...ToT] for (2) secs
end
Last edited by PiglinZumbi (July 1, 2020 03:00:03)
- Gohoski
-
100+ posts
Creating extensions for Scratch 3.0
I am having some trouble with hosting the extension with github pages. I got to the mod, loaded the extension, and…. nothing happens. But I get errors in the console. Here's the error:
Also, here is the link to the extension: https://surprise4.github.io/Internet_3.js
shared-dispatch.js:130 Uncaught (in promise) TypeError: Cannot read property ‘yield’ of nullCan someone please help me?
at shared-dispatch.js:130
at new Promise (<anonymous>)
at WorkerDispatch._remoteTransferCall (shared-dispatch.js:126)
at WorkerDispatch.transferCall (shared-dispatch.js:82)
at WorkerDispatch.call (shared-dispatch.js:59)
at extension-worker.js:28
(anonymous) @ shared-dispatch.js:130
_remoteTransferCall @ shared-dispatch.js:126
transferCall @ shared-dispatch.js:82
call @ shared-dispatch.js:59
(anonymous) @ extension-worker.js:28
Promise.then (async)
(anonymous) @ extension-worker.js:15
Promise.then (async)
ExtensionWorker @ extension-worker.js:14
(anonymous) @ extension-worker.js:57
(anonymous) @ extension-worker.js:58
__webpack_require__ @ bootstrap:19
(anonymous) @ bootstrap:83
(anonymous) @ bootstrap:83
Also, here is the link to the extension: https://surprise4.github.io/Internet_3.js
Last edited by Gohoski (July 14, 2020 12:53:44)
- Codigador
-
80 posts
Creating extensions for Scratch 3.0
Can you show the resulting block?Creating extensions for Scratch 3.0There is now official documentation regarding extensions!, but feel free to use this post to get you started
You'll want to start off by creating your extension's class, and register the extension - In my case, this would be ‘NitroBlock’class NitroBlock { //In both instances, NitroBlock will be the name in both instances } Scratch.extensions.register(new NitroBlock());
Next, we will be constructing block and menu definitions - We will continue to use ‘NitroBlock’ through this tutorialgetInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [ ], "menus": { //we will get back to this in a later tutorial } }; }
We are going to take a look at how blocks are constructed
For those of you that are familiar with extensions for Scratch 2.0, we will start off with this: - If not, you can ignore this['r', 'letters %n through %n of %s', 'substringy', '2', '5', 'hello world'] //breakdown below: ['r' = block type, 'letters %n through %n of %s' = block text, 'substringy' = block ID/opcode]{ "opcode": "substringy", //This will be the ID code for the block "blockType": "reporter", //This can either be Boolean, reporter, command, or hat "text": "letters [num1] through [num2] of [string]", //This is the block text, and how it will display in the Scratch interface "arguments": { //Arguments are the input fields in the block. In the block text, place arguments in square brackets with the corresponding ID "num1": { //This is the ID for your argument "type": "number", //This can be either Boolean, number, or string "defaultValue": "2" //This is the default text that will appear in the input field, you can leave this blank if you wish }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } },
We will put this newly constructed code into the blocks object above - My code will now look like thisclass NitroBlock { getInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [{ "opcode": "substringy", "blockType": "reporter", "text": "letters [num1] through [num2] of [string]", "arguments": { "num1": { "type": "number", "defaultValue": "2" }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } }, }], "menus": { //we will get back to this in a later tutorial } }; } Scratch.extensions.register(new NitroBlock());
Next we come to the most important part, the code that actually runs the blocks! - I am keeping this short and simple for tutorial's sake.//Make sure you name this function with with the proper ID for the block you defined above substringy({num1, num2, string}) { //these names will match the argument names you used earlier, and will be used as the variables in your code //this code can be anything you want return string.substring(num1 - 1, num2); //for reporters and Boolean blocks the important thing is to use 'return' to get the value back into Scratch. }
Place this new code below your getInfo() functionclass NitroBlock { getInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [{ "opcode": "substringy", "blockType": "reporter", "text": "letters [num1] through [num2] of [string]", "arguments": { "num1": { "type": "number", "defaultValue": "2" }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } }, }], "menus": { //we will get back to this in a later tutorial } }; substringy({num1, num2, string}) { return string.substring(num1 - 1, num2); }; }
Save this code to your computer as a js file, in my case it is NitroBlock_3.js
Congratz, you now have your extension code created!!
You can use this tutorial to add it your own personal copy of scratch
Or, you can host the extension with gh-pages, and go here to test it (provide your own url, don't use mine)
Here is the archived copy of my original post
- PiglinZumbi
-
17 posts
Creating extensions for Scratch 3.0
The result block is:Can you show the resulting block?Creating extensions for Scratch 3.0There is now official documentation regarding extensions!, but feel free to use this post to get you started
You'll want to start off by creating your extension's class, and register the extension - In my case, this would be ‘NitroBlock’class NitroBlock { //In both instances, NitroBlock will be the name in both instances } Scratch.extensions.register(new NitroBlock());
Next, we will be constructing block and menu definitions - We will continue to use ‘NitroBlock’ through this tutorialgetInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [ ], "menus": { //we will get back to this in a later tutorial } }; }
We are going to take a look at how blocks are constructed
For those of you that are familiar with extensions for Scratch 2.0, we will start off with this: - If not, you can ignore this['r', 'letters %n through %n of %s', 'substringy', '2', '5', 'hello world'] //breakdown below: ['r' = block type, 'letters %n through %n of %s' = block text, 'substringy' = block ID/opcode]{ "opcode": "substringy", //This will be the ID code for the block "blockType": "reporter", //This can either be Boolean, reporter, command, or hat "text": "letters [num1] through [num2] of [string]", //This is the block text, and how it will display in the Scratch interface "arguments": { //Arguments are the input fields in the block. In the block text, place arguments in square brackets with the corresponding ID "num1": { //This is the ID for your argument "type": "number", //This can be either Boolean, number, or string "defaultValue": "2" //This is the default text that will appear in the input field, you can leave this blank if you wish }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } },
We will put this newly constructed code into the blocks object above - My code will now look like thisclass NitroBlock { getInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [{ "opcode": "substringy", "blockType": "reporter", "text": "letters [num1] through [num2] of [string]", "arguments": { "num1": { "type": "number", "defaultValue": "2" }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } }, }], "menus": { //we will get back to this in a later tutorial } }; } Scratch.extensions.register(new NitroBlock());
Next we come to the most important part, the code that actually runs the blocks! - I am keeping this short and simple for tutorial's sake.//Make sure you name this function with with the proper ID for the block you defined above substringy({num1, num2, string}) { //these names will match the argument names you used earlier, and will be used as the variables in your code //this code can be anything you want return string.substring(num1 - 1, num2); //for reporters and Boolean blocks the important thing is to use 'return' to get the value back into Scratch. }
Place this new code below your getInfo() functionclass NitroBlock { getInfo() { return { "id": "NitroBlock", "name": "NitroBlock", "blocks": [{ "opcode": "substringy", "blockType": "reporter", "text": "letters [num1] through [num2] of [string]", "arguments": { "num1": { "type": "number", "defaultValue": "2" }, "num2": { "type": "number", "defaultValue": "5" }, "string": { "type": "string", "defaultValue": "hello world" } } }, }], "menus": { //we will get back to this in a later tutorial } }; substringy({num1, num2, string}) { return string.substring(num1 - 1, num2); }; }
Save this code to your computer as a js file, in my case it is NitroBlock_3.js
Congratz, you now have your extension code created!!
You can use this tutorial to add it your own personal copy of scratch
Or, you can host the extension with gh-pages, and go here to test it (provide your own url, don't use mine)
Here is the archived copy of my original post
NitroBlock
Last edited by PiglinZumbi (July 20, 2020 19:22:45)