diff --git a/server_mc_manager.py b/server_mc_manager.py index 0135661..df94b76 100644 --- a/server_mc_manager.py +++ b/server_mc_manager.py @@ -76,6 +76,8 @@ class MinecraftServerManager: return None def get_online_players(self, port) -> int: + if not self.servers[port]: + return 0 with mcipc.query.Client('127.0.0.1', port) as client: stats: mcipc.query.proto.FullStats = client.stats(full=True) stats: int = stats.num_players