### Install aio-mc-rcon Source: https://pypi.org/project/aio-mc-rcon/3.4.1 Install or upgrade the aio-mc-rcon library using pip. Ensure you specify the version for exact compatibility. ```bash pip install -U aio-mc-rcon ``` -------------------------------- ### Client.connect Source: https://pypi.org/project/aio-mc-rcon Establishes a connection to the Minecraft server. ```APIDOC ## Client.connect ### Description Establishes an asynchronous connection to the RCON server. ### Method `connect(timeout: int = 2)` ### Parameters * `timeout` (int) - The maximum time in seconds to wait for the connection. Defaults to 2 seconds. ``` -------------------------------- ### Client Initialization Source: https://pypi.org/project/aio-mc-rcon Initializes the RCON client with server connection details. ```APIDOC ## Client Initialization ### Description Initializes the RCON client with the server's host, port, and password. ### Arguments * `host` (str) - The hostname or IP address of the Minecraft server. * `port` (int) - The RCON port of the Minecraft server. * `password` (str) - The RCON password, found in `server.properties` under `rcon.password`. ``` -------------------------------- ### Client.send_cmd Source: https://pypi.org/project/aio-mc-rcon Sends a command to the Minecraft server and returns the response. ```APIDOC ## Client.send_cmd ### Description Sends a command to the Minecraft server and returns the server's response. ### Method `send_cmd(cmd: str, timeout: int = 2)` ### Parameters * `cmd` (str) - The command to execute on the Minecraft server. * `timeout` (int) - The maximum time in seconds to wait for a response. Defaults to 2 seconds. ### Response * Returns the command output from the server as a string. ``` -------------------------------- ### Client Class Source: https://pypi.org/project/aio-mc-rcon/3.4.1 The Client class is used to establish a connection to a Minecraft RCON server and send commands. ```APIDOC ## Class: aiomcrcon.Client ### Description Initializes a new RCON client. ### Arguments * `host` (str) - The hostname or IP address of the Minecraft server. * `port` (int) - The RCON port of the Minecraft server. * `password` (str) - The RCON password, found in `server.properties` under `rcon.password`. ### Methods #### connect(timeout: int = 2) * Description: Establishes a connection to the RCON server. * Parameters: * `timeout` (int) - The maximum time in seconds to wait for the connection. Defaults to 2. #### send_cmd(cmd: str, timeout: int = 2) * Description: Sends a command to the RCON server and returns the response. * Parameters: * `cmd` (str) - The command to execute on the server. * `timeout` (int) - The maximum time in seconds to wait for a response. Defaults to 2. * Returns: The server's response to the command. #### close() * Description: Closes the connection to the RCON server. ``` -------------------------------- ### Exceptions Source: https://pypi.org/project/aio-mc-rcon/3.4.1 Custom exceptions raised by the aio-mc-rcon library. ```APIDOC ## Exceptions ### aiomcrcon.RCONConnectionError * Description: Raised when the connection to the RCON server fails. ### aiomcrcon.IncorrectPasswordError * Description: Raised when the provided RCON password is incorrect. ### aiomcrcon.ClientNotConnectedError * Description: Raised when attempting to send a command before establishing a connection using `connect()`. ``` -------------------------------- ### Exceptions Source: https://pypi.org/project/aio-mc-rcon Details on exceptions that can be raised by the aio-mc-rcon library. ```APIDOC ## Exceptions ### `RCONConnectionError` Raised when the connection to the RCON server fails. ### `IncorrectPasswordError` Raised when the provided RCON password is invalid. ### `ClientNotConnectedError` Raised when attempting to send commands before establishing a connection using `connect()`. ``` -------------------------------- ### Client.close Source: https://pypi.org/project/aio-mc-rcon Closes the connection to the Minecraft server. ```APIDOC ## Client.close ### Description Closes the active connection to the RCON server. ### Method `close()` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.