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.
MinecraftServer extends GenericServer with Minecraft-specific capabilities powered by the HungerBridge v2 API. In addition to the full Pterodactyl control surface inherited from GenericServer, it connects to a running HungerBridge plugin instance to expose live TPS readings, online player counts and names, authenticated console command execution, and tellraw broadcasts — all without opening a WebSocket console.
A BridgeClient instance is created automatically during construction and stored at self.bridge. You can call self.bridge methods directly for lower-level access.
Constructor
Human-readable label for this server. Passed through to
GenericServer.Authenticated
Panel instance. Passed through to GenericServer for all Pterodactyl API calls.Pterodactyl server short UUID. Passed through to
GenericServer.Hostname or IP address where the Minecraft server is reachable, e.g.
"mc.example.com" or "10.0.0.5". Used to construct the HungerBridge base URL and stored as self.server_domain.The Minecraft game port (typically
25565). Stored as self.server_port for reference; not used internally for bridge communication.The port that the HungerBridge HTTP API is listening on. Combined with
server_domain to build http://{server_domain}:{bridge_port} and passed to the BridgeClient constructor.The
X-Auth-Key token configured in HungerBridge. Passed directly to BridgeClient.self.bridge holds the BridgeClient instance for direct low-level access.
Minecraft Methods
getPlayers()
/v2/players endpoint and returns either a count or a list of online player names.
Controls what is returned:
"count"— returns the integer number of online players."list"— returns alist[str]of online player usernames.
int when mode="count", list[str] when mode="list", or None if the bridge is unreachable.
Raises InvalidModeError if mode is not "count" or "list".
getTPS()
/v2/tps endpoint. Returns None silently on invalid mode rather than raising, making it safe to call in monitoring loops.
Which TPS measurement to return. Maps directly to
BridgeClient.getTPS(mode):"current"— EMA20, the smoothed near-real-time TPS."1m"— EMA over the last ~1200 ticks (≈1 minute)."5m"— EMA over the last ~6000 ticks (≈5 minutes)."tick_time"— Average tick duration in milliseconds.
Number of decimal places to round the result to. Pass
None to skip rounding.float rounded to rounding places, or None if the mode is invalid or the bridge returns no data.
sendConsoleCommand()
BridgeClient.runCommand().
The Minecraft server command to execute, without a leading
/, e.g. "op Steve" or "say Hello".When
True, the command and its output are echoed to the server console log.When
True, suppresses any in-game feedback messages produced by the command.When
True (default), output lines are joined into a single str. When False, the raw bridge response dict is returned.str of normalised output when normalize=True, the raw dict response when normalize=False, or None if the bridge returns no output.
sendBroadcast()
tellraw @a command to display a message to all online players. Double-quotes in message are automatically escaped.
The plain-text message to broadcast to all players. Do not include JSON formatting — the method wraps the text in a minimal
tellraw JSON object.tellraw command (typically an empty string or None).
Inherited Methods
MinecraftServer inherits every method from GenericServer without modification. Refer to the GenericServer reference for full documentation of:
- Resources:
refresh(),resources(),getRAM(),getCPU(),getDisk(),getNetworkIn(),getNetworkOut(),getUptime() - Status:
getStatus(),isOnline(),isOffline() - Power:
powerAction(),start(),stop(),restart(),kill() - Files:
listFiles(),downloadFile(),uploadFile(),deleteFiles(),renameFiles(),copyFiles(),moveFiles(),createFolder(),compress(),decompress() - Backups:
listBackups(),createBackup(),deleteBackup(),downloadBackup() - Databases:
listDatabases(),createDatabase(),rotateDatabasePassword(),deleteDatabase() - Startup:
getStartupVariables(),updateStartupVariable() - Schedules:
listSchedules(),createSchedule(),updateSchedule(),deleteSchedule(),runSchedule(),enableSchedule(),disableSchedule(),getSchedule()