mcstatus is a Python library designed to query Minecraft servers (Java Edition and Bedrock Edition) for their status and capabilities, including player counts, server version, MOTD, and latency. It supports both synchronous and asynchronous operations. The current version is 13.0.1 and it's actively maintained with regular updates.
pip install mcstatusVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to asynchronously connect to a Minecraft Java Edition server, retrieve its status, and print key information like version, player count, and latency. It uses `asyncio.run` for a runnable async entry point.
Update your imports from `from mcstatus import MinecraftServer` to `from mcstatus import JavaServer` for Java Edition servers, or `from mcstatus import BedrockServer` for Bedrock Edition.
Ensure your environment uses Python 3.10 or newer. Consider using a virtual environment and updating your Python interpreter if needed.
Remove the `async_` prefix when calling asynchronous methods (e.g., `await server.status()` instead of `await server.async_status()`).
Instead of `server.ping()`, use `server.status().latency` to retrieve the ping value.
Adjust any code expecting `timedelta` operations on the `latency` value. It is now a simple numeric value in milliseconds.
Update your import and class usage to `JavaServer` for Java Edition servers, or `BedrockServer` for Bedrock Edition servers (e.g., `from mcstatus import JavaServer` and `server = JavaServer.lookup(...)`).
Double-check the server IP address and port. Verify the Minecraft server is running and accessible from your network. Check local firewall settings on both the client and server machines.
Ensure you `await` asynchronous calls, e.g., `status = await server.status()` instead of `status = server.status()`.
No dependency data recorded yet.