Skip to main content

A package letting you interact with a Java Minecraft server through RCON

Project description

minecraft-rcon-client

A simple class to allow you to interact with a minecraft server. The server must have rcon enabled in server.properties:

enable-rcon=true
rcon.port=2000
rcon.password=secret

Usage

import asyncio

from minecraft import Server

async def main():
    ip = "1.1.1.1"
    port = 2000 # rcon port
    password = "password"

    # can be used in a context manager
    async with Server(ip, port, password) as server:
        print(await server.send("list"))

    # can also be used procedurally
    server = Server(ip, port, password, connect_on_send=True)
    # connect_on_send make it so the Server tried to reconnect if
    # it's disconnected, otherwise it raises a NotConnectedError
    print(await server.send("list"))

    for i in await server.online():
        print(f"{i} is online")

    await server.close()

asyncio.run(main())

Requirements

Python >= 3.6

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minecraft-crazygmr101-0.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

minecraft_crazygmr101-0.1.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page