This commit is contained in:
2022-03-30 16:08:06 +02:00
parent d9d42ad735
commit dbf34c639d
9 changed files with 131 additions and 0 deletions

18
tests/minecraft.py Normal file
View File

@@ -0,0 +1,18 @@
from mcstatus import JavaServer
server = JavaServer.lookup('sfs.ddnss.org:25565', 10)
server = JavaServer('sfs.ddnss.org', 25565)
print('got server')
status = server.status()
print(f"The server has {status.players.online} players and replied in {status.latency} ms")
print(server.status())
print(vars(server.status()))
print(server.query())
query = server.query()
print(f"The server has the following players online: {', '.join(query.players.names)}")