Dinnerbone/mcstatus

socket.timeout

MrIncognito7 opened this issue · 1 comments

my code --
import mcstatus
server = 'hypixel.net'
def main(server):
server = mcstatus.MinecraftServer.lookup(server)
result = server.status()
query = server.query()
print(f"The server has {result.players.online} players online and replied in {result.latency}")
try:
print(f"{query.players.names}")
except:
print("Cannot list players connected")

main()


error -
image

I still haven't gotten around to improving this experience as part of #136. Please check firewall ports and make sure UDP is allowed to access the query port that has to also be enabled in server.properties for the Minecraft server.

This exception is not a bug for mcstatus. It is an exception happening in your setup due to misconfiguration of the network/firewall. In Python, it is up to the programmer to handle exceptions with a try-except block and/or fix the underlying issue that was causing the exception in the first place.