ConstAdd a method to handle a specific use case of a shared action
Action ID
Handler options
Check if there is an active and available handler in the current situation for a shared action
Find the active handler in the current situation for a shared action
Optionalevent: EventOptionalcontext: anyRun the active handler for a specific subject manually
Action ID
Optionalevent: EventEvent that triggered the interaction
Optionalcontext: anyOptional context variable
Run a specific handler manually
Action ID
Subject to run on
Optionalevent: EventEvent that triggered the interaction
Optionalcontext: anyOptional context variable
Optionalforce: booleanForce the specified handler to run and ignore its condition
Shared Actions is a system in Blockbench to allow actions (including in toolbars, menus, via action control, or keybinding) to run different code in different cases, such as in different modes or different panels. As an example, the "Duplicate" action runs code to duplicate elements when used in the outliner, and duplicates textures when used in the textures panel.
Handlers can be added for existing actions like this:
Example: