๐จ Command Schema
This documentation aims to introduce you to bridge.'s proprietary, internal JSON schema for command validation and auto-completions. You will learn about the following topics:
โ๏ธ The JSON format and its structure.
โ๏ธ How to define new commands.
โ๏ธ How to define new selector arguments.
โ๏ธ How to define new subcommands.
TIP
You can find the internal file for bridge.'s command schema here. We also have a JSON schema for the format.
Meta
Regular Types
Type | Description |
---|---|
command | Pop state and suggest another defined command |
string | Any string is valid |
number | Decimal or integer number |
boolean | Boolean; true or false literal |
selector | Minecraft selector, e.g. @s |
molang | Molang statement, e.g. "query.is_jumping + 1" |
blockState | Block state, e.g. [variant=smooth] |
jsonData | JSON data, e.g. {"foo": "bar"} |
scoreData | Score data, e.g. {my_score=1..4} |
coordinate | Coordinate; one number or ~ /^ |
subcommand | Proceed to propose any of this command's subcommands |
integerRange | Integer range, e.g. 0 , 1.. or 1..4 |
Custom Types
Define custom types to be used within the schema.
json
{
"$customTypes": {
"coordinates": [
{
"type": "coordinate"
},
{
"type": "coordinate"
},
{
"type": "coordinate"
}
]
}
}
The example above would allow you to reference your custom type as $coordinates
wherever you would normally use a regular type. Internally, bridge. then replaces $coordinates
with the array of types you defined.