A lightweight Minecraft client to query the status of a Minecraft server
Project description
MCClient
A lightweight Minecraft client to query the status of a Minecraft server.
Supported Mincraft versions
- Minecraft Java (1.4.* -> 1.19.*)
- Minecraft Bedrock
Supported protocols
- ServerListPing for Minecraft java servers
- Legacy ServerListPing for Minecraft java servers before 1.4
- Query Protocol for Minecraft java servers (this needs to be enabled on the server)
- Bedrock ServerListPing for Bedrock servers
Installation
pypi
pip install mcclient-lib
Note: The pypi package isn't always up to date. If you want to use the latest version you will have to clone this repository and then install the package locally.
Usage
ServerListPing
from mcclient import SLPClient
# for Minecraft Java servers from 1.7.*
slp_client = SLPClient("mc.example.com", port=12345)
res = slp_client.get_status()
Query
from mcclient import QueryClient
# for Minecraft Java servers (needs to be enabled on the server)
query_client = QueryClient("mc.example.com", port=12345)
res = query_client.get_status()
Bedrock ServerListPing
from mcclient import BedrockSLPClient
# for Minecraft Bedrock servers
bedrock_slp_client = BedrockSLPClient("mc.example.com", port=12345)
res = bedrock_slp_client.get_status()
Response
How to handle the returned response object
motd = res.motd
online_players = res.players.online
max_players = res.players.max
player_list = res.players.list
version = res.version.name
protocol_version = res.version.protocol
# only for query responses
plugins = res.plugins
# only for basic ServerListPing
has_favicon = res.favicon
# only for query and Bedrock
gametype = res.gametype
# only for query and bedrock
map = res.map
# only for bedrock
server_id = res.server_id
Queryable data
- motd
- online player count
- max player count
- player list
- server version
- server protocol version
- mods and plugins
- has a favicon
- name of map
- hostport and hostip
- gametype
- server id
Note: not every field is queryable with every protocol
Documentation
You can find more documentation here, if that isn't enough just look into the source.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcclient-lib-0.8.13.tar.gz
(9.3 kB
view details)
Built Distribution
File details
Details for the file mcclient-lib-0.8.13.tar.gz
.
File metadata
- Download URL: mcclient-lib-0.8.13.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b62cdb424696ffe4e86c6a7ac37097fbc6b5e6be1fcf05de8cff0a905e1af4e |
|
MD5 | 9b7f0eaa74b3e7b413fe3a8d854b6ab8 |
|
BLAKE2b-256 | 308669849ed1a1a0a227671dc7a184b5bb7fde4dab89b04fcaa54b9f633a5378 |
File details
Details for the file mcclient_lib-0.8.13-py3-none-any.whl
.
File metadata
- Download URL: mcclient_lib-0.8.13-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b2b651650b8aa40dba3e688a723b5e77ee1ac804d7e014cf73144a7a47b0958 |
|
MD5 | 68f177e9346bc67ea822503be889af19 |
|
BLAKE2b-256 | 48dcfa6a7c80088fed519503b269c5ac1deefed2e3bc9e8795f7d655d25072c7 |