Built with MCPyLib

Projects that use MCPyLib, and example scripts you can run on your server.

Map Art

MCPyLib Map Art turns an image into blocks that show it on an in-game map. A map pixel’s color depends on the block and on its height relative to the block north of it, so staircase mode varies heights to get 180 colors instead of a flat build’s 60.

The source logo: a yellow crescent moon and a tangerine in a box, with the words Night Tangerine.The same logo as simulated Minecraft map art in staircase mode with dithering, 1024 blocks wide.
Drag to compare the source image with the simulated map. 1024 × 1024 blocks, simulated without a server.

How close each mode gets

ModePSNR (dB)SSIMMean errorColors used
Flat17.190.962960.6129
Flat + dithering17.150.943060.9136
Staircase29.480.97574.1765
Staircase + dithering28.850.95844.5999

Higher PSNR and SSIM and lower mean error are closer to the source. Measured with the project’s simulator on the logo above.

A color gradient through the modes

128 × 128 color gradient rendered in Source mode
Source
128 × 128 color gradient rendered in Flat, 60 colors mode
Flat, 60 colors
128 × 128 color gradient rendered in Staircase + dithering, 180 colors mode
Staircase + dithering, 180 colors

Block heights behind the picture

Grayscale height map of the staircase build: darker areas are lower blocks.
Each column steps up or down relative to its northern neighbor. Darker is lower.
  • Offline simulator that previews the result and reports PSNR and SSIM
  • Perceptual color matching and Floyd–Steinberg dithering
  • Command line, interactive menu and a tkinter GUI
MCPyLib Map Art on GitHub

Terrain

MCPyLib Terrain generates landscapes offline, then places them with chunk-sized edit() calls.

Isometric voxel view of a generated island with beaches, forest, rock and a snow-capped peak.
The island, block by block. Real height and biome data from the island example, sampled every 12 blocks.

Shaded relief from the generator

Shaded relief map of a generated mountain range: snow on the ridges, rock, forest and rivers.
Mountain range: 1024 × 1024 blocks, heights Y 34 to 270, sea level Y 32.
Shaded relief map of an island generated from a heightmap image.
Island from a heightmap image: 1024 × 1024 blocks, heights Y 22 to 315.
  1. Heightmapridged multifractal noise, domain warping and tectonic uplift
  2. Erosionhydraulic droplets carve valleys, thermal erosion forms scree
  3. HydrologyD8 flow accumulation carves rivers and fills them with water
  4. Biomeseight bands from deep sea to snow peaks, with ores underground
  5. Placementchunk-based mc.edit() calls on a live server

Example scripts

From the repository’s examples folder. Each reads its token from a .env file.

  • build_cabin.py

    examples/buildings/build_cabin.py

    A 30 × 30 log cabin next to the player, with interior walls, a loft, stairs, furniture and a pitched roof.

    • fill()
    • setblock()
    • teleport()
  • build_maze.py

    examples/buildings/build_maze.py

    Generates a maze with depth-first search, with adjustable corridor and wall widths, and builds it in one edit() call.

    • fill()
    • edit()
    • setblock()
  • build_structures.py

    examples/buildings/build_structures.py

    Bulk-edit examples, each timed: a cube, a striped concrete tower, a house with a named chest and a sign, and a 50 × 50 platform built both ways.

    • edit()
    • fill()
  • sand_cache_game.py

    examples/games/sand_cache_game.py

    A mini-game: a sealed stone-brick tower holds 20 to 60 sand blocks, with red sand always on top.

    • fill()
    • setblock()
  • 03_entity_control.py

    examples/basics/03_entity_control.py

    Summons a pig, a zombie and a villager, then freezes AI, teleports, sets velocity, targets and custom trades.

    • summon()
    • setEntityAI()
    • setVillagerTrades()
  • fill_vs_edit.py

    examples/benchmarks/fill_vs_edit.py

    The benchmark behind the performance numbers: fill() against edit() on five region sizes.

    • fill()
    • edit()