Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server
http://dinnerbone.com/minecraft/tools/status/
1.11k stars 146 forks source link

Query times out every time #164

Closed nondious closed 2 years ago

nondious commented 2 years ago

this is the code, and it just results in it timing out every time.

from mcstatus import MinecraftServer server = MinecraftServer.lookup("") query = server.query() print("The server has the following players online: {0}".format(", ".join(query.players.names)))

kevinkjt2000 commented 2 years ago

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.