(Redirected from Undefined Blocks)

SandCastleIcon.png This article has links to websites or programs outside of Scratch and Wikipedia. Remember to stay safe while using the internet, as we cannot guarantee the safety of other websites.
undefined
An obsolete block

Obsolete blocks are blocks that are not compatible with the version of Scratch being used; the interpreter cannot recognize them as actual blocks. They can be obtained by adding new code to a Scratch project's JSON file, which holds all specifications for a project. These blocks could previously be resurrected or created by using the Shift-Click-R method. Most of the resurrected blocks fail to work, but the stretch, abs, sqrt, point away from the edge, and some other blocks will function. The typical obsolete block is a command block, yet can fit in the space of any other type of block, as can be seen if you open up a project containing an (answer) block from Scratch 1.4 in any lower version of Scratch. Most of these blocks are red. The obsolete block that says "obsolete!" does nothing, and it is what all obsolete blocks appear as in the Experimental Viewer.

Undefined blocks are blocks that cannot be found as an actual script, and are undefined. One can get them as explained at the Getting an Obsolete or Undefined Block section.

For a list of obsolete blocks, see List of Obsolete Blocks.

Obsolete Blocks in 1.3/1.4

say nothing
Some obsolete
blocks work in
Scratch 1.4 but
turn red.
obsolete!::#FF0000
An obsolete block that does not work in 1.4

There are a large number of Looks blocks that do not have a function but had already been added to Scratch. The point away from the edge:: motion block was regarded as full of glitches and impractical [citation needed] — which is part of the reason that caused it to be removed from the November 2006 beta release.

Obsolete Blocks in 1.0-1.2

Main article: Experimental Blocks

There are many hidden blocks under 1.0-1.2.1, but the functions have not been completely explained. The start/stop movie blocks indicate that an experimental version of video support may have once existed.

These blocks can be found by Shift-clicking the Extras menu and clicking on "Show experimental blocks". In 1.1 and 1.2, these are accessed by the Shift-Click-R method.

There were 13 experimental Sound Blocks and 10 experimental Sensing Blocks.

How to Make an Obsolete Block

Scratch 3.0

This uses the backpack[1] like so:

  1. Make a custom block.
  2. Put the block in the backpack. Do not put the define block.
  3. Go to another project and put the custom block in.
  4. You have now made an undefined block.

Scratch 2.0

To obtain an obsolete (or undefined) block in Scratch 2.0, the user will need to create a custom block and drag the block (NOT the definition script) into their backpack. Once the user takes it out, it will turn into a red undefined block.

One can also create a obsolete block that is not colored or renamed by creating a custom block in either the stage or a sprite, and drag the block, NOT the definition script, into another sprite or without a custom block with the same name, and the block will become obsolete (but not colored red or renamed) because there is no definition script within the new sprite to define the block's procedure.

Scratch 1.x

There are two ways to get obsolete blocks in Scratch 1.x:

  1. Get an obsolete block from a Scratch Modification. These are the steps:
    1. Download and open a Scratch Modification that has blocks that are incompatible with Scratch (do not exist in Scratch) such as Snap! or Panther.
    2. Put one of these blocks into a sprite
    3. Export the sprite
    4. Open this sprite in Scratch, and it will contain an obsolete block
  2. Edit the Scratch source to include a method and a blockspec that is not in the normal Scratch. When others download or play it, the block turns obsolete.

Offline/Online Sensor

Main article: Interface Detection
Archive.png
The subject of this article or section has changed dramatically and requires updating. Some information or images may not be accurate or relevant to the current version of Scratch, the Scratch website, or the article subject. (March 2022)


Obsolete blocks can also be used to detect whether a user is playing a project in the Java Player or the Experimental Viewer. Online, the script stops when it detects an undefined block, whereas when the project is played in Scratch 1.4, the script ignores the undefined block and carries on with the script. An offline/online sensor can be created with this script:

when green flag clicked
set [Offline/Online v] to [Online]
undefined
set [Offline/Online v] to [Offline]

A more complex version is this:

when green flag clicked
set [Playing... v] to [Offline]
broadcast ((0) / (0))
set [Playing... v] to [Online Java]
undefined
set [Playing... v] to [Online Flash]

Obsolete Hat Blocks in Scratch 3.0

Main article: Undefined Hat Block
The result of when an invalid opcode is given to a block. It is both a hat block and a cap block.

In Scratch 3.0 obsolete blocks are no longer red, unlike in 2.0. However, when a project's JSON is edited and an invalid block is created, the red block that appears as the result is the most similar thing as the undefined block in older versions. This block can be downloaded here: looks_code.sb3

See Also

References

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