Skip to content
Projects

About

Minecraft Interactive world builder

Systems & Infrastructure

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

CI Coverage PyPI License

mciwb

Minecraft Interactive World Builder: build in a Minecraft Java Edition world from Python scripts.

mciwb places blocks by sending commands to a Minecraft server over RCON, so it works with an unmodified server and the current Minecraft release. It starts a local server for you, runs your build scripts against it, backs the world up and restores it, and draws what you built to an image.

It is for two kinds of builder:

  • People directing an AI agent. An agent cannot see the game, so it builds with a script, renders the result to an image and checks the blocks in code. mciwb comes with a skill that teaches Claude Code this loop.
  • Python developers writing build scripts by hand, with builders for roofs, arches, stairways, roads and foundations that follow the terrain.
What Where
Source https://github.com/gilesknap/mciwb
Install pip install git+https://github.com/gilesknap/mciwb.git
Container podman run --rm ghcr.io/gilesknap/mciwb:latest --version
Documentation https://gilesknap.github.io/mciwb
Releases https://github.com/gilesknap/mciwb/releases

Quick start

Start a local Minecraft server (it runs in Podman) and build in it from a script:

mciwb start            # a Minecraft 26.3 server on localhost
mciwb run build.py     # run a build script
mciwb render --centre 637 78 -1658 --size 30 20 30   # draw it to render.png

Join the game at localhost:20101 before you run the script: Minecraft only builds near a player. build.py is:

from mciwb.imports import (
    Direction, Item, Vec3, gable_roof, get_client, get_world, polygon,
)

world = get_world()
pos = Vec3(632, 73, -1658)  # the spawn point of the default world
world.set_block(pos, Item.GOLD_BLOCK)
# a hollow square tower 7 wide and 5 high, with a roof on top
tower = pos + Direction.EAST * 10
polygon(get_client(), tower, height=5, diameter=7, item=Item.STONE_BRICKS)
gable_roof(tower + Vec3(-3, 4, -3), tower + Vec3(3, 4, 3), Item.SPRUCE_STAIRS)

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.

The tutorials go through this step by step, and the reference describes every function.

Built with mciwb

The two castles in examples were built by an AI agent writing mciwb scripts, and are the examples to read for the building API.

Castle Fable II seen from the south west

  • Castle Fable: a hillside castle about 140 x 165 blocks, with a moat, a working portcullis, traps and secret passages. It shows the builders on uneven ground: foundation and ground_height for the earthworks, stairway and road between the wards, gable_roof, hip_roof, arch and column for the buildings, and Placer for its own parts. A second script checks every mechanism.
  • Castle Fable II (above, drawn with mciwb render): the same castle with a village of 32 timber-framed houses, farm animals, people at work and ten puzzle machines. It shows a large build made from another's modules, houses in many variants from one function, BlockState for blocks with states, and world.render to check the result.

Credits

mciwb is built on mcipc, the client library for Minecraft RCON. Its geometry, items and shapes began as the mcwb library, which is now part of mciwb.

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

Explore related projects

Loading…