Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Loading Extensions into Scratch GUI (Full Guide)
- crater24
-
Scratcher
12 posts
Loading Extensions into Scratch GUI (Full Guide)
NOTE: If you are looking to create an extension, see https://scratch.mit.edu/discuss/topic/277217/
Step 1: Create the metadata
Navigate to where you cloned the GUI.
For me, this is /home/pi/scratch3, so I would go to /home/pi/scratch3/scratch-gui
Open the extension folder
This is located at scratch-gui/src/lib/libraries/extensions (as of time of writing).
Edit index.jsx
Open index.jsx in your favorite text editor.
Add the entry
Look at the picture below, and copy the object. The description of each property is below the image.

extensionId the unique ID of your extension.
description Only change the “defaultMessage” property of the element. the id should always be "gui.extension.your extension id here.description"
featured It is best to leave this alone. Setting it to false will make your extension super tiny.
useAutoScan leave this alone unless you absolutely want Scratch Link to scan for devices when the extension is loaded.
bluetoothRequired if true, a bluetooth icon shows up in the “Requires” section
internetConnectionRequired if true, a wifi icon shows up in the “Requires” section
collaborator The text under the “collaboration with” section.
Step 2: Setting up the actual extension
If you try to launch Scratch GUI now, your extension will not work.
It may ask you for a URL; Scratch may crash. This is because you need to add the actual code to the extension.
Navigate to the ScratchVM folder
Navigate to scratch-gui/node_modules/scratch-vm.
From there, go to src/extensions.
Create a folder called scratch3_<your extension id>

In this folder, create a file called index.js. Open it with your favorite text editor.
Extension Code
Start by loading the dependecines.

If you have any other dependencies, you can load them too via require. For example, I have an audio file called “rickroll.mp3”
Create the class. Ths can be named anything you want, as long as it follows the JavaScript syntax for variable names.

Use the constructor code, and make sure there is one argument (runtime). Any code inside the constructor code will run when your extension is loaded.
Creating the blocks
Start by creating the getInfo function.
the syntax is mostly similar to the official creating extensions post https://scratch.mit.edu/discuss/topic/277217/ except with some key differences.
Paramater, block, and extension names all have to be encoded in formatMessage, and block types have to use the BLOCKTYPE class.

At the end, use the code "module.exports = <insert your class name>" to export it.

Recognizing the extension
Navigate to scratch-vm/src/extension-support. Open “extension-manager.js”.
Add a line inside the builtInExtensions object declaring <your extension id>: () => require("./scratch3_your extension id again"),

Visit localhost:8601 and head back to the scratch-gui folder.
Open up the terminal and run cd directory where scratch gui is installed/scratch-gui && npm start
Click on the “extensions” button at the bottom of the toolbox, scroll down, and you should see your extension!

Step 1: Create the metadata
Navigate to where you cloned the GUI.
For me, this is /home/pi/scratch3, so I would go to /home/pi/scratch3/scratch-gui
Open the extension folder
This is located at scratch-gui/src/lib/libraries/extensions (as of time of writing).
Edit index.jsx
Open index.jsx in your favorite text editor.
Add the entry
Look at the picture below, and copy the object. The description of each property is below the image.

extensionId the unique ID of your extension.
description Only change the “defaultMessage” property of the element. the id should always be "gui.extension.your extension id here.description"
featured It is best to leave this alone. Setting it to false will make your extension super tiny.
useAutoScan leave this alone unless you absolutely want Scratch Link to scan for devices when the extension is loaded.
bluetoothRequired if true, a bluetooth icon shows up in the “Requires” section
internetConnectionRequired if true, a wifi icon shows up in the “Requires” section
collaborator The text under the “collaboration with” section.
Step 2: Setting up the actual extension
If you try to launch Scratch GUI now, your extension will not work.
It may ask you for a URL; Scratch may crash. This is because you need to add the actual code to the extension.
Navigate to the ScratchVM folder
Navigate to scratch-gui/node_modules/scratch-vm.
From there, go to src/extensions.
Create a folder called scratch3_<your extension id>

In this folder, create a file called index.js. Open it with your favorite text editor.
Extension Code
Start by loading the dependecines.

If you have any other dependencies, you can load them too via require. For example, I have an audio file called “rickroll.mp3”
Create the class. Ths can be named anything you want, as long as it follows the JavaScript syntax for variable names.

Use the constructor code, and make sure there is one argument (runtime). Any code inside the constructor code will run when your extension is loaded.
Creating the blocks
Start by creating the getInfo function.
the syntax is mostly similar to the official creating extensions post https://scratch.mit.edu/discuss/topic/277217/ except with some key differences.
Paramater, block, and extension names all have to be encoded in formatMessage, and block types have to use the BLOCKTYPE class.

At the end, use the code "module.exports = <insert your class name>" to export it.

Recognizing the extension
Navigate to scratch-vm/src/extension-support. Open “extension-manager.js”.
Add a line inside the builtInExtensions object declaring <your extension id>: () => require("./scratch3_your extension id again"),

Visit localhost:8601 and head back to the scratch-gui folder.
Open up the terminal and run cd directory where scratch gui is installed/scratch-gui && npm start
Click on the “extensions” button at the bottom of the toolbox, scroll down, and you should see your extension!

- My_Third_Account
-
Scratcher
29 posts
Loading Extensions into Scratch GUI (Full Guide)
Well I used to have a windows computer, but it broke when I bent it too far and now i'm on ChromeOS not windows, macOS, or Linux.
(this is oppisite, still whispered.) Noooooooooo!!!
(this is oppisite, still whispered.) Noooooooooo!!!
when [ move da muscle like arm or leg and think you have good luck] key pressed
play sound [ Noooooo!!! I need my PC!] until done
point towards [ Resinance]
think [...]
play sound [ I hate ASUS! Attack!] until done
- BA4X
-
Scratcher
63 posts
Loading Extensions into Scratch GUI (Full Guide)
NOTE: If you are looking to create an extension, see https://scratch.mit.edu/discuss/topic/277217/your probably inactive now, but this helped me so much. thanks
Step 1: Create the metadata
Navigate to where you cloned the GUI.
For me, this is /home/pi/scratch3, so I would go to /home/pi/scratch3/scratch-gui
Open the extension folder
This is located at scratch-gui/src/lib/libraries/extensions (as of time of writing).
Edit index.jsx
Open index.jsx in your favorite text editor.
Add the entry
Look at the picture below, and copy the object. The description of each property is below the image.
extensionId the unique ID of your extension.
description Only change the “defaultMessage” property of the element. the id should always be "gui.extension.your extension id here.description"
featured It is best to leave this alone. Setting it to false will make your extension super tiny.
useAutoScan leave this alone unless you absolutely want Scratch Link to scan for devices when the extension is loaded.
bluetoothRequired if true, a bluetooth icon shows up in the “Requires” section
internetConnectionRequired if true, a wifi icon shows up in the “Requires” section
collaborator The text under the “collaboration with” section.
Step 2: Setting up the actual extension
If you try to launch Scratch GUI now, your extension will not work.
It may ask you for a URL; Scratch may crash. This is because you need to add the actual code to the extension.
Navigate to the ScratchVM folder
Navigate to scratch-gui/node_modules/scratch-vm.
From there, go to src/extensions.
Create a folder called scratch3_<your extension id>
In this folder, create a file called index.js. Open it with your favorite text editor.
Extension Code
Start by loading the dependecines.
If you have any other dependencies, you can load them too via require. For example, I have an audio file called “rickroll.mp3”
Create the class. Ths can be named anything you want, as long as it follows the JavaScript syntax for variable names.
Use the constructor code, and make sure there is one argument (runtime). Any code inside the constructor code will run when your extension is loaded.
Creating the blocks
Start by creating the getInfo function.
the syntax is mostly similar to the official creating extensions post https://scratch.mit.edu/discuss/topic/277217/ except with some key differences.
Paramater, block, and extension names all have to be encoded in formatMessage, and block types have to use the BLOCKTYPE class.
At the end, use the code "module.exports = <insert your class name>" to export it.
Recognizing the extension
Navigate to scratch-vm/src/extension-support. Open “extension-manager.js”.
Add a line inside the builtInExtensions object declaring <your extension id>: () => require("./scratch3_your extension id again"),
Visit localhost:8601 and head back to the scratch-gui folder.
Open up the terminal and run cd directory where scratch gui is installed/scratch-gui && npm start
Click on the “extensions” button at the bottom of the toolbox, scroll down, and you should see your extension!
- Discussion Forums
- » Developing Scratch Extensions
-
» Loading Extensions into Scratch GUI (Full Guide)



