Skip to main content

Documentation Status

mcipc

A Minecraft inter-process communication API implementing the RCON and Query protocols.

News

2020-12-21 - mcipc-2.0

Great news: mcipc is now available in version 2. The version 2 update includes the outsourcing of the RCON protocol and client implementation into an own project. This allowes for the RCON library to be used independently of mcipc, e.g. for other games which support the RCON protocol. Furthermore mcipc's RCON client implementations have been overhauled. They now provide functions to interact with the respective server. It was therefor necessary to not have one implementation of mcipc.rcon.Client, but three:

  • mcipc.rcon.be.Client Client for Bedrock Edition servers.
  • mcipc.rcon.ee.Client Client for Education Edition servers.
  • mcipc.rcon.je.Client Client for Java Edition servers.

To provide some backwards compatibility, the mcipc.rcon.Client is now an alias for mcipc.rcon.je.Client. You'll find a full documentation of each client's capabilities, i.e. methods in the documentation.

Requirements

mcipc requires Python 3.9 or higher. It also depends on rcon which has been split from this project. If you install mcicp via pip, it will automatically be installed as a dependency.

Documentation

Documentation is available on readthedocs.

Quick start

Install mcipc from the AUR or via:

pip install mcipc

Query protocol

The Query protcol is used to query a Minecraft server for server information. The Minecraft query protocol has two query modes: basic stats and full stats.

from mcipc.query import Client

with Client('127.0.0.1', 25565) as client:
    basic_stats = client.stats()            # Get basic stats.
    full_stats = client.stats(full=True)    # Get full stats.

print(basic_stats)
print(full_stats)

RCON protocol

The RCON protocol is used to remotely control a Minecraft server, i.e. execute commands on a Minecraft server and receive the respective results.

from mcipc.rcon.je import Biome, Client     # For Java Edition servers.
#from mcipc.rcon.be import Client           # For Bedrock Edition servers.
#from mcipc.rcon.ee import Client           # For Education Edition servers.

with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
    seed = client.seed                              # Get the server's seed.
    players = client.list()                         # Get the server's players info.
    mansion = client.locate('mansion')              # Get the next mansion's location.
    badlands = client.locatebiome(Biome.BADLANDS)   # Get the next location of a badlands biome.

print(seed)
print(players)
print(mansion)
print(badlands)

Example output of the above commands with a Java Edition client:

-8217057902979500137
Players(online=1, max=20, players=[Player(name='coNQP', uuid=None, state=None)])
Location(name='mansion', x=-7216, y=None, z=-1952, distance=7479)
Location(name='minecraft:badlands', x=1512, y=None, z=3388, distance=3634)

Credits

Many thanks to all contributers to the Minecraft Wiki and the Wiki.vg.

License

Copyright (C) 2018-2021 Richard Neumann

mcipc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

mcipc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with mcipc. If not, see http://www.gnu.org/licenses/.

Minecraft content and materials are trademarks and copyrights of Mojang and its licensors. All rights reserved. This program is free software and is not affiliated with Mojang.

Metadata

Release files for mcipc 2.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcipc 2.4.2
File Size Uploaded Provenance Actions
mcipc-2.4.2.tar.gz 105.4 kB Without provenance Details for mcipc-2.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcipc 2.4.2
File Interpreter ABI Platform Actions
mcipc-2.4.2-py3-none-any.whl Python 3 none any Details for mcipc-2.4.2-py3-none-any.whl

Total release size: 233.3 kB

Release files / mcipc-2.4.2.tar.gz

Download URL mcipc-2.4.2.tar.gz
Size 105.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b2899b5749f12c26a477e7d8cdcea65bc96c65b795728825d24fed3447af43dc
BLAKE2b-256 checksum
How to use checksums
7203be382784dd025555df9fff1e52817f4168706c4d4bdcb7f842c70bb2a968
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.6

Release files / mcipc-2.4.2-py3-none-any.whl

Download URL mcipc-2.4.2-py3-none-any.whl
Size 127.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1a14d06956ab8e7a0571b2dc0f9a2ea509f44c1c49845b27355d7c116d8c580
BLAKE2b-256 checksum
How to use checksums
f1c603a85f19488df0a1f7b37af45460c464b969758fc0bd8f00bd42f20eef61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.6

Security for mcipc 2.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.4.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page