Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/iFamishedX/HungerLib/llms.txt

Use this file to discover all available pages before exploring further.

CommandAPI provides a single method for dispatching console commands to a running server through the Pterodactyl Client API. It is accessible as panel.commands on every Panel instance. This API sends commands through the Pterodactyl panel’s command endpoint, which injects input directly into the server’s console stdin. It is fire-and-forget — no output is returned. If you need to send a Minecraft command and capture the response (e.g. reading player lists or TPS output), use MinecraftServer.sendConsoleCommand() via a BridgeClient connection instead, which communicates through HungerBridge’s RCON/console relay.
from hungerlib import Panel

panel = Panel("https://panel.example.com", "ptlc_yourtoken")

# Send a console command directly
panel.commands.send("abc123", "say Server restarting in 5 minutes!")

send

Sends a single console command to the server. The command is injected into the server’s stdin as if typed in the Pterodactyl console. Endpoint: POST /api/client/servers/{server_id}/command
panel.commands.send(server_id, command)
server_id
str
required
The short identifier of the target server (e.g. "abc123").
command
str
required
The raw console command string to send. Do not include a leading / for Minecraft commands unless the server’s console requires it — Pterodactyl passes the string verbatim.
Returns: requests.Response — A 204 No Content response on success. No command output is returned.
# Broadcast a message to all players
panel.commands.send("abc123", "say Hello from HungerLib!")

# Save the world on a Minecraft server
panel.commands.send("abc123", "save-all")

# Stop the server
panel.commands.send("abc123", "stop")
CommandAPI.send() routes through the Pterodactyl WebSocket console and does not return any output. For Minecraft servers where you need to capture command responses — such as reading online player counts or TPS — use MinecraftServer.sendConsoleCommand() through a BridgeClient connection, which leverages HungerBridge’s RCON relay.

Build docs developers (and LLMs) love