MoLang Schema Dump
MoLang Schema Dump
Section titled “MoLang Schema Dump”The /journey dump-molang command exports a JSON file containing all registered MoLang queries, event types, and condition providers from your Journey server. This dump can be imported into the Config Builder to give Blockly and autocompletion full awareness of your server’s custom MoLang context.
Running the Command
Section titled “Running the Command”/journey dump-molangThis outputs a file at config/journey/molang-dump.json.
Output Format
Section titled “Output Format”The dump JSON follows this schema:
{ "queries": [ { "name": "q.player.level", "signature": "q.player.level()", "description": "Player XP level", "returnType": "Number", "category": "Player" } ], "events": [ { "id": "POKEMON_CAPTURE", "label": "Pokemon Captured", "dataPaths": [ { "path": "event.species", "type": "String", "description": "The species of the captured Pokemon" } ] } ], "conditions": [ { "id": "journey:has_badge", "description": "Player has a specific badge", "pattern": "journey:has_badge:<badge_id>" } ]}Field Descriptions
Section titled “Field Descriptions”| Field | Description |
|---|---|
queries[].name | Full query path (e.g. q.player.level) |
queries[].signature | Call signature with parameters |
queries[].description | Human-readable description |
queries[].returnType | Number, String, Boolean, or Void |
queries[].category | Grouping category (e.g. Player, NPC, Math) |
events[].id | Event type ID (uppercase, e.g. POKEMON_CAPTURE) |
events[].dataPaths | Available data accessors for this event |
conditions[].id | Condition identifier |
conditions[].pattern | Condition pattern with <param> placeholders |
Importing into Config Builder
Section titled “Importing into Config Builder”- Open the Config Builder
- Click Import MoLang Schema in the top bar
- Select your
molang-dump.jsonfile - The schema is merged with built-in definitions and persisted in your browser
After import, new queries will appear in the Blockly toolbox under an “Imported” category, and autocompletion will include all server-registered functions.
Developing the Dump Command
Section titled “Developing the Dump Command”If you are developing the Journey mod and need to implement the /journey dump-molang command, it should:
- Introspect all registered
MoLangQueryimplementations - Iterate over all
EventTypeenum values and theirDataPathdefinitions - Collect all registered
ConditionProviderentries - Serialize to the JSON schema above
- Write to
config/journey/molang-dump.json - Send a confirmation message to the command sender