Scratch Addons supports getting and modifying Redux state!

Keep in mind

  • Redux is only available on scratch-www pages (the ones with the thicker navigation bar) and the editor.
  • Some extensions conflict with Scratch Addons’ Redux feature. Do not use this when unnecessary.
  • We expect readers to have basic knowledge on Redux and Scratch’s reducers.

Get Redux state stores current Redux state. For example, to get message count:

Wait for Redux state returns a Promise that will resolve when the Redux state meets the given condition.

conditionFunctionYesA function that takes Redux state as a parameter and returns whether to keep waiting or not.
actionsString | String[]NoAll possible valuesThe action(s) to check for.


You must first call for Scratch Addons to be able to listen for state changes.

Use"statechanged", callback) to add event listeners for state changes. The callback can have one argument which is a CustomEvent with following attributes:

  • action: Dispatched action. See Redux docs for what it means.
  • prev: Previous state.
  • next: Next state.

Dispatching event

You can dispatch events using Event object must have type attribute and can have other attributes. For details on what to dispatch, read reducer codes on scratch-www, scratch-gui or scratch-paint: