Skip to content
On this page

๐Ÿ–จ 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

TypeDescription
commandPop state and suggest another defined command
stringAny string is valid
numberDecimal or integer number
booleanBoolean; true or false literal
selectorMinecraft selector, e.g. @s
molangMolang statement, e.g. "query.is_jumping + 1"
blockStateBlock state, e.g. [variant=smooth]
jsonDataJSON data, e.g. {"foo": "bar"}
scoreDataScore data, e.g. {my_score=1..4}
coordinateCoordinate; one number or ~/^
subcommandProceed to propose any of this command's subcommands
integerRangeInteger 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.

Released under the GPL-3.0 License.