mirror of
https://github.com/JonasunderscoreJones/Minecraft-server-Status.git
synced 2025-10-22 18:29:17 +02:00
Uploaded cmd.py v0.1
This commit is contained in:
parent
0250564a55
commit
41d38bf3bf
1 changed files with 28 additions and 0 deletions
28
cmd-v0.1.py
Normal file
28
cmd-v0.1.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from mcstatus import MinecraftServer
|
||||
from time import sleep
|
||||
|
||||
ip = input("Please Enter server IP: ")
|
||||
port = input("Enter Port (press enter for default port 25565): ")
|
||||
|
||||
#temporary variable def
|
||||
ip = "simp.ztereohype.codes"
|
||||
|
||||
if port == "":
|
||||
port = "25565"
|
||||
|
||||
server = MinecraftServer.lookup(ip + ":" + port)
|
||||
|
||||
|
||||
while True:
|
||||
status = server.status()
|
||||
query = server.query()
|
||||
print("---------- " + ip + ":" + port + " ----------")
|
||||
print(f"version: v{status.version.name} (protocol {status.version.protocol})")
|
||||
print(f'description: "{status.description}"')
|
||||
|
||||
print(f"host: {query.raw['hostip']}:{query.raw['hostport']}")
|
||||
print(f"software: v{query.software.version} {query.software.brand}")
|
||||
print(f"plugins: {query.software.plugins}")
|
||||
print(f"players: {status.players.online}/{status.players.max}")
|
||||
print(f"Players Online: {query.players.names}")
|
||||
print("\n")
|
Loading…
Add table
Add a link
Reference in a new issue