Skip to main content

block object keys

a list of all keys that go into a block object, there types, and there functional meaning. keep in mind that in place of this object can be put '---' to represent a gap (but only one, adding more does not increase the gap)

keytypefunction
opcodestring | nulldefines the id of this block, can be omitted on some things (like comments and xml blocks)
blockTypeScratch.BlockTypethe type of this block (I.E. command, comment or reporter)
textString | Array<String>the text of this block, when an array it represents the text on every "leg" of a block with multiple branches
blockIconURIString | nullan override for the categories blockIconURI, sets the image to be put at the start of the block and spaced from the text with |
extensionsArray<String> | nullgets mapped to the blockly param extensions (see here for explanation)
color1String | null must match /^#[0-9a-f]{6}$/ian override for the color1 property from the category
color2String | null must match /^#[0-9a-f]{6}$/ian override for the color2 property from the category
color3String | null must match /^#[0-9a-f]{6}$/ian override for the color3 property from the category
allowDropAnywhereBoolean | nullif this block can be put into any input regardless of type (only works on blockType reporter)
branchCountNumber | nullan unsigned integer that states how many branches should be on this block (set to one if falsey on blockType loop)
checkboxInFlyoutBoolean | nullwhether or not there should be a monitor checkbox for this block in the toolbox, only set to true on reporter and boolean type blocks if the reporter has no arguments
disableMonitorBoolean | nullsynonym of checkboxInFlyout
branchIndicatorString | nullthe indecator that should be appended to the end of the last leg in this block (only works on blocks with legs), if this property is in the object but is set to null-like then the icon ./static/blocks-media/repeat.svg is used instead
branchIconURIString | nullsynonym of branchIndicator
alignmentsArray<Scratch.ArgumentAlignment>see here
blockShapeScratch.BlockShapesee here
forceOutputTypeString | nulloverrights all output types on this block to be set with the string inputed, does nothing on falsey values
isDynamicBoolean | nullsets up this block to use a mutator to store the block shape and allow for dynamic handling of the blocks shape (no system to actualy do this atm though), the code for this also seems to be utterly untouched since the orignal concievment of scratch3 and so probably needs updated
arguments{[String]: Argument}see bellow for the shape of the objects contained inside this list, to use these arguments you simply put into the strings of the text value [argName] where argName is the name of the argument in this list.
isEdgeActivatedBoolean | nullonly on hat/event blocks, defines if this block, when triggered by function evalutation, should continue to trigger for every instance the output is true or only trigger on instances where the output has changed to be true

Argument

keytypedescription
typeScratch.ArgumentTypethe type of this argument, certain types may use special key values in the argument
dataURIString | nullused only by the "image" argument type to state the image data to display
widthString | nullused only by the "image" argument type to state the image width
heightString | nullused only by the "image" argument type to state the image height
flipRTLBoolean | nullused only by the "image" argument type to state that the image should be flipped in rtl translations
defaultValueany | nullthe value of this argument that is set by default
menuString | nullthe key name of the menu that should take place of this argument
nodesNumber | nullthe number of nodes a polygon argument should have, this key name only applies to polygon arguments
exemptFromNormalizationBoolean | nullif this input should be automaticaly casted to the inputs type

block type specialties

COMMAND:

most basic of basics, when ran it does something, can be connected with other command blocks via the top and bottom or reporter bocks can be connected to it via arguments

REPORTER:

makes a block that can connect to inputs and itself output a value when ran, the shape is either set seperately or round

BOOLEAN:

makes a block that can only connect to boolean inputs and output a true/false value, the shape is hexagonal

HAT:

EVENT: