Skip to main content

Utilities for automating Minecraft building via the Minecraft websocket API

Project description

wsminer

Minecraft Python Scripting

This library facilitates writing Python scripts to automate building in Minecraft. Note that this does not work with realms or console based versions of Minecraft as they do not have the appropriate functionality. Minecraft has a command to connect to a local server using a websocket connection. To facilitate iterative development of build scripts, this library consists of a server remains connected to your Minecraft application and a library of commands to send to the server. The server then relays the commands to the Minecraft application.

To use this library.

  1. Start the server using the following command. The server will print out a command that you should run within the Minecraft chat window. python -m wsminer.server

  2. Startup Minecraft

  3. Connect to the server using the command that was printed out by the server. This should be run from the chat window.

  4. Write and run a Python script to connect to the server and send commands.

import asyncio
import wsminer

async def main():
    client = wsminer.Client()
    await client.connect()
    await client.build_pyramid(20, 'glowstone')
    # await client.draw_cone(50, 'ice')
    # await client.draw_sphere(20, 'cobblestone')
    # await client.draw_image_nn("butterfly.png")

asyncio.get_event_loop().run_until_complete(main())

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

wsminer-0.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

wsminer-0.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file wsminer-0.1.tar.gz.

File metadata

  • Download URL: wsminer-0.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for wsminer-0.1.tar.gz
Algorithm Hash digest
SHA256 34777993924cc4b2504209eee2a1063f76c719797ffbc62f92d345a153bca528
MD5 4f2f67aff0d56d7dd72f2a61907eb269
BLAKE2b-256 b5a08458aa8cafc61370c05bd08512ba5e890db82abcfec4a211e38147830605

See more details on using hashes here.

File details

Details for the file wsminer-0.1-py3-none-any.whl.

File metadata

  • Download URL: wsminer-0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for wsminer-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d7b8488a3c82e02b196be1d42e7e7611bdc6117f548b2d9744ef0f601ef9be1
MD5 e336fc7d7ce063c17e74566d8fd99b09
BLAKE2b-256 da642b1b5b76228f17badcde7e38414508eecbe6efd6c58e8004546bc2672efc

See more details on using hashes here.

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