Перейти к содержанию
SoulFire LogoSoulFire

Execute command

Это руководство доступно только на английском.

POST
/v1/commands:execute

Executes a command string within the specified scope. The command is parsed and executed using the Brigadier command dispatcher.

Permission requirements depend on the scope:

  • Global scope: Requires GLOBAL_COMMAND_EXECUTION permission
  • Instance scope: Requires INSTANCE_COMMAND_EXECUTION for the instance
  • Bot scope: Requires INSTANCE_COMMAND_EXECUTION for the parent instance

Authorization

headerAuthorizationBearer <JWT>

Preferred API authentication. Use a JWT with the api audience.

Request Body

application/json
  1. body

Request message for executing a server command.

scope*

The execution scope that determines which instances/bots the command can affect and what permissions are required. Must be set to one of the scope options.

command*string

The command string to execute. This follows the Brigadier command format, e.g., "help", "move 100 64 200", "say Hello world". Leading/trailing whitespace will be stripped before execution.

Response Body

Response message containing the result of command execution.

application/json
  1. response

Response message containing the result of command execution.

code*integer

The exit code returned by the command.

  • 0: Command failed or had no effect (e.g., syntax error, no targets found)
  • 1 (Command.SINGLE_SUCCESS): Command executed successfully
  • 1: Command succeeded and affected multiple targets (count of affected items) Note: Syntax errors return 0 and error details are sent via the logging system.

Formatint32
Example Request
curl -X POST 'http://127.0.0.1:38765/v1/commands:execute' \
  -H 'Content-Type: application/json' \
  -d '{
  "command": ""
}'
Example Response
{
  "code": 0
}

Полезна ли эта страница?