List the player usernames that have signed to a Minecraft server lately
Project description
Minecraft Server Player List
Quick script that generates a list of recent players on your server, sorted
in order of who last logged in. Works by looking at the last modified time of
their player.dat
files in <server root>/world/playerdata
, and resolving
those UUIDs to a playername using Mojang's API.
Caching
Optionally, you can write out the usernames to a cache file (to prevent API rate
limiting) using the --cache-file
option. Usernames will only be looked up
again after 120s.
Usage
$ mc_players -h
usage: mc_players [-h] [--out OUT] [--cache-file CACHE_FILE] [--cache-expiry CACHE_EXPIRY] [--html] [-n N] [--servername SERVERNAME] worldpath
Generate a list of recent players on a minecraft server.
positional arguments:
worldpath Path to the world folder to scan (eg <server_root>/world)
options:
-h, --help show this help message and exit
--out OUT Path to output file, defaults to stdout
--cache-file CACHE_FILE
Path to cache file (created if not exists) to prevent rate limiting
--cache-expiry CACHE_EXPIRY
Look up usernames that haven't been looked up in n seconds
--html
-n N Only return the last n usernames, default all
--servername SERVERNAME
Server name for use in output
Example Output
Plain Text
$ python3 playerlist.py /opt/mc/world
Players last seen on server
=================================================
1 Bob Mon Oct 05 2020, 11:01 PM
2 Dan Mon Oct 05 2020, 10:28 PM
3 George Mon Oct 05 2020, 03:06 PM
HTML
$ python3 playerlist.py --html /opt/mc/world
<html>
<head>
<!-- generated with github.com/jaydenmilne/minecraft-server-player-list -->
<title>server players</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
</head>
<body>
<h1>Players on server</h1>
<table>
<tr><th>Place</th><th>Player</th><th>Last Seen</th></tr>
<tr><td>1<td>Bob</td><td>Tue Oct 06 2020, 07:33 PM</td></tr>
<tr><td>2<td>Dan</td><td>Tue Oct 06 2020, 07:06 PM</td></tr>
<tr><td>3<td>George</td><td>Tue Oct 06 2020, 06:39 PM</td></tr>
</table>
</body>
</html>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mc_players-2.1.0.tar.gz
(17.1 kB
view hashes)
Built Distribution
mc_players-2.1.0-py3-none-any.whl
(17.4 kB
view hashes)
Close
Hashes for mc_players-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0264e508bcb589e862bdba3154bdd1461b5cb007917c60ebebce10fc7c694a |
|
MD5 | 2fe4b4bc6f218296363e8eb19f41ef0a |
|
BLAKE2b-256 | 2f088c0d90cf13baa1ab7c105595186297ae9e032a1761bf32a20e8c003ea20b |