This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective.
The red hacked block.
The block as a Cat Block.

An undefined hat block[1] was a block that generated when attempting to load an invalid block. Blocks could not be connected to the undefined hat block, and it did not have any function. Some Scratchers call it a Hat Block,[2] but it was actually a combination of both a hat and Cap Block. It did not have an input, and was the only red block in Scratch 3.0. Unlike other blocks, it did not have an outline, and did not change color when the Color Mode was set to High Contrast. It was removed in April of 2026 following an update to the Online Editor.

Attempting to comment on an Undefined Hat Block caused an invisible and corrupted comment to generate. If a sprite had an Undefined Hat Block with the corrupted comment, switching to the Costume Editor or Sound Editor and back to the Code Tab would have caused a crash, although switch to another sprite and back would have simply remove the comment instead. Attempting to drag an Undefined Hat Block with a corrupted comment would have caused the block to stick to the cursor, even after attempting to let go. Going to a different sprite while it was stuck to the mouse caused the block to disappear from the cursor, and attempting to go back to the original sprite caused the Context Menu to stop working and made all blocks within the project immobile.

Generating

Because this block could never be found in the block palette, it required the below methods to make:

Method 1

One way of generating this block was to edit the project JSON file.[3] The steps are as follows:

  1. Make a new project and drag a block.
  2. Save the project to your computer and rename the .sb3 file extension to .zip.
  3. Decompress the .zip file, and locate the .json file from the generated folder
  4. Open the .json file, locate the block, and rename it to something that doesn't exist.
  5. Change the file extension back to .sb3 and load it from your computer.
  6. The project should now have the block.

Method 2

An undefined hat block could be simply be put in the backpack from an other person's projects.

Method 3

Trying to create a custom block with a name containing a control character, such as the backspace character or a NAK (Negative Acknowledge) character previously caused the creation of an undefined block.[4]

NAK (U+0015) can be copied from the browser: First, search for %15. Then copy the character from the search bar. If the character was pasted into a custom block, the undefined hat block would have appear. However, putting it into an existing project would have caused caused every script in the project to disappear (although the scripts would have remained functional).

See Also

References

Cookies help us deliver our services. By using our services, you agree to our use of cookies.