An asynchronous RCON client/wrapper written in Python for Minecraft Java Edition servers!
pip install -U aio-mc-rcon
- See the examples folder.
- Arguments:
host: str- The hostname / ip of the server to connect to.port: int- The port of the server to connect to.password: str- The password to connect, can be found as the value underrcon.passwordin theserver.propertiesfile.
- Methods:
connect(timeout: int = 2)- wheretimeouthas a default value of 2 seconds.send_cmd(cmd: str, timeout: int = 2)- wherecmdis the command to be executed on the server and timeout has a default value of 2 seconds.close()- closes the connection between the client and server.
- Raised when the connection to the server fails.
- Raised when the provided password/authentication is invalid.
- Raised when the connect() method hasn't been called yet, and commands cannot be sent.