Skip to content

Repository files navigation

Minecraft Settlement Generator

Procedurally generates a settlement in an existing Minecraft world using a genetic algorithm for placement and modular builds for construction.


Requirements

  • Minecraft Java Edition
  • GDMC HTTP mod — exposes a local HTTP interface that lets Python communicate with the game
  • Python 3.9+

Install Python dependencies:

pip install gdpc numpy

Setting the build area

The generator works inside a rectangular area you define in-game. To set it, open the Minecraft chat and run:

/setbuildarea x1 y1 z1 x2 y2 z2

For example, to mark a 100×100 area starting at your current position:

/setbuildarea ~ ~ ~ ~100 255 ~100

This command is added by the GDMC HTTP mod. The generator reads this area automatically when it starts — no coordinates need to be set in the Python code.


Running

With Minecraft open and the GDMC HTTP mod loaded, run:

python main.py

The script will:

  1. Read the build area you set in-game
  2. Run the genetic algorithm to find placement spots for 11 houses and a worship place
  3. Flatten the terrain at each site
  4. Build all structures and decorate the interiors
  5. Adapt block materials to the local biome

Module overview

File Role
main.py Entry point — orchestrates the full pipeline
SearchPlacingXZ.py Genetic algorithm that finds optimal (x, z) positions for all buildings
HouseBuilder.py Constructs the houses and their interiors
ChurchBuilder.py Constructs the worship place and its chandelier
MinecraftStructure.py Loads pre-built structures from JSON and places them in-world with biome adaptation
structures/ JSON files for the 9 house modules and the worship place modules

About

Procedurally generates a settlement in Minecraft using a genetic algorithm for placement and modular builds for construction.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages