Skip to content
gilesknapPublic

About

Minecraft Interactive world builder

Topics

Resources

Contributing

Stars

307 stars

Watchers

4 watching

Forks

Repository files navigation

CI Coverage PyPI License

mciwb

Minecraft Interactive World Builder.

This project is intended as a fun way to learn the Python Programming Language.

Experienced Python programmers can also use this library to create Minecraft worlds with interactive Python features.

What Where
Source https://github.com/gilesknap/mciwb
Install pip install git+https://github.com/gilesknap/mciwb.git
Container podman run --rm -it --network host ghcr.io/gilesknap/mciwb:latest shell
Documentation https://gilesknap.github.io/mciwb
Releases https://github.com/gilesknap/mciwb/releases

Quick Start

To get started learning Python, see Introduction

For existing Python developers, see API documentation

In short: start a local Minecraft server and build in it from a script:

mciwb start            # a Minecraft 26.3 server in podman, on localhost
mciwb run build.py     # run a build script, or `mciwb shell` for IPython

where build.py uses the world object and the names from mciwb.imports:

pos = Vec3(632, 73, -1658)
world.set_block(pos, Item.GOLD_BLOCK)
polygon(get_client(), pos + Direction.EAST * 10, height=5, diameter=7)

The commands use the RCON password default_pass unless you give one. Give it with --password-file FILE or the MCIWB_PASSWORD environment variable rather than --password, which other users can see with ps.

Example Build

The pagoda and castle with working portcullis were all created programmatically with Python and the current version of MCIWB.

castle-2023-03-15_08.26.24.mp4

An earlier video shows the castle being built; the source code for the village is in src/mciwb/demo/village.py.

Screencast.from.14-03-23.20.33.36.mov

Goals

Minecraft Interactive World Builder's goals are:

  • Use Python to create anything inside of Minecraft worlds.
  • Call Python code when events occur inside the world.
  • Use an iPython prompt to interact with the world by typing Python commands
  • Have your player inside the world execute Python code by placing command signs or activating switches/levers with Python actions.

All instructions on how to set up a Minecraft Server and the Python developer environment are included. There are step by step tutorials to introduce Python Programming and the features of Minecraft Interactive World Builder.

Note: this is a work in progress. There are now enough tutorials to learn the fundamentals of Python and enough functionality to have some fun interacting with Minecraft from Python code.

Credits

This project would not be possible without mcipc, which provides the client library for Minecraft RCON.

See https://gilesknap.github.io/mciwb for more detailed documentation.

About

Minecraft Interactive world builder

Topics

Resources

Contributing

Stars

307 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages