Macro Handler · Developer SDK

Build your own block.

Describe Lua behavior and editable fields in one .mhblock file. The same package is used in visual and logic workspaces.

Create in the app

  1. In a visual or logic workspace, open Add block → Plugins → Create block.
  2. Enter the package ID, version and name. Write the Lua code; use Add property to define editable keys, types and defaults. Read them as inputs.key in code.
  3. Use Preview properties to try the fields on a detached draft. Preview does not run code or change the open macro.
  4. After review, explicitly choose Add to block library. Use Export .mhblock to share the package; installing or exporting does not start a macro.

Saved content for an ID and version is immutable. Bump the version after edits; a library update does not change copies already embedded in macros.

Define → validate → import

  1. Start from an included example; edit its package ID, version and inputs.
  2. Run the offline commands below with Node.js. The packer does not overwrite existing files.
  3. In the app, use Add block → Import → Plugins. Inspect the code and test in a separate trial macro first.
node mhblock.mjs validate examples/repeated-log.mhblock
node mhblock.mjs pack examples/repeated-log.mhblock --out my-block.mhblock
node --test test/package.test.mjs

Versions and scope

Schema 1
Lua code with text, number, boolean and choice inputs.
Schema 2
Allowlisted descriptors for four engines already in the app. No new native code is loaded.
Schema 3 · 1.0.51 reader
Help text, field groups, numeric bounds, color, variable name, point and region for Lua blocks. A reader build supporting this schema is required; acceptance by older readers is not assumed.

Schema 3 is a prepared reader capability; this does not mean it is supported by the Google Play 1.0.50 baseline.

Packages are limited to 256 KiB and 24 inputs. This file is not a macro ZIP, webpage, APK, DEX or downloaded native library.

Author with MH AI or another assistant

Give the assistant the English brief, schema and an example. Request a complete JSON package; do not invent screen coordinates, permissions or undocumented APIs. MH AI offers structurally checked drafts as .mhblock downloads; it does not import or execute them automatically.

Security and distribution

The author and native.source fields are not signatures or publisher verification. Packages cannot elevate app permissions. Google Play policies still apply to interpreted Lua; this SDK does not certify Play compliance.

Google Play · Device and Network Abuse(opens in a new tab)
Back to the official block library