TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/iFamishedX/HungerBridge/llms.txt
Use this file to discover all available pages before exploring further.
/v2/run endpoint executes a Minecraft console command on the server’s main thread and optionally returns the log output it generates. Output is captured using a log4j appender that is temporarily injected into the root logger while the command runs, making it compatible with both Fabric and Paper/Purpur platforms.
Request
Method:POSTPath:
/v2/runContent-Type:
application/json
Headers
| Header | Required | Description |
|---|---|---|
X-Auth-Key | Yes | Authentication key from config.yaml → auth.key |
Content-Type | Recommended | Should be application/json |
Configuration
This endpoint can be disabled inconfig.yaml under v2-endpoints.run. It is enabled by default.
Request Body
The console command to execute. Do not include a leading
/. For example, use "say Hello" rather than "/say Hello". The command is dispatched on the server main thread using the console sender (Fabric: server.createCommandSourceStack(); Paper: server.getConsoleSender()).When
true, the output field is omitted from the response and only {"ok": true} is returned. Use this when you do not need to inspect command output and want to minimise response size.Controls whether command output is also printed to the server’s own console during capture. When
false (the default), all existing log appenders are temporarily removed from the root logger so that captured output stays silent on the server side. When true, both the capture appender and the original appenders run concurrently, so output appears in the server console and in the API response.Response
true on success.An array of trimmed log lines generated by the command. Present only when
silent is false and the platform returns non-null output. Each element is a single formatted log message with leading/trailing whitespace removed. Empty lines are excluded.The field is absent entirely when silent: true. When silent is false, the field is included as long as the executor returns a non-null list (which is the normal case on both platforms).Example Response — Default (silent: false)
Example Response — Silent Mode (silent: true)
Error Responses
| Status | error field | message field | Cause |
|---|---|---|---|
400 | bad_request | Missing field: command | Request body is missing or does not contain the command field |
401 | unauthorized | Invalid X-Auth-Key | Missing or incorrect X-Auth-Key header |
403 | forbidden | v2 run disabled | Endpoint disabled via v2-endpoints.run: false |
405 | method_not_allowed | Use POST | Request method was not POST |
curl Examples
Run a command and capture output
Run silently (fire-and-forget)
Run with console output visible on the server
Commands are always dispatched on the server main thread and the HTTP request blocks until the command and output capture are complete. For commands that produce a lot of output or take time to complete, be aware that the HTTP request will hold open for that duration.