mojang.minecraft.rcon

mojang.minecraft.rcon.session(addr: tuple[str, int], password: str, timeout: float | None = 3) Generator[Callable[[str], str], None, None]

Open a RCON connection

Parameters:
  • addr (tuple) – The address and the port to connect to

  • password (str) – The RCON password set in the server properties

  • timeout (int) – Time to wait before closing pending connection (default to 3)

Example:

>>> from mojang.minecraft import rcon
>>> with rcon.session(("localhost", 25575), "my_super_password") as send:
...     send("help")  # This execute the /help command