How bytewife/agentcraft works
AgentCraft turns a selected Minecraft build area into an adaptive settlement: it reads terrain, initializes a social-agent simulation, develops roads and buildings through agent actions and world-state updates, then renders changes and records settlement history. The graph shows the documented generation and rendering workflow plus schematic construction and chronicle output. Several source files are only partially excerpted; edges are limited to relationships visible in excerpts or explicitly documented in the README/index.
Main entry points: states.py Settlement state · simulation.py Simulation controller · agent.py Social agents · interfaceUtils.py Minecraft HTTP interface
Components 19
Run control
- CLI launcher
run.py
Minecraft interface
- Minecraft HTTP interface
http_framework/interfaceUtils.py - World slice loader
http_framework/worldLoader.py - Packed block data
http_framework/bitarray.py - Block color palette
http_framework/blockColors.py
Settlement simulation
- Simulation controller
src/simulation.py - Settlement state
src/states.py - Social agents
src/agent.py - Pathfinding
src/pathfinding.py - Block manipulation
src/manipulation.py - Building schemes
src/scheme_utils.py - Settlement nodes
src/node.py - Road segments
src/road_segment.py - Line drawing
src/line_drawing.py - World rules
src/utils.py
Output records
- Settlement chronicle
src/chronicle.py
Other components
- Generator user
- Running Minecraft
- Schematic assets
schemes
Connections 24
- Generator user → CLI launcher: sets area and limits
README.md - CLI launcher → Simulation controller: starts simulation
run.py - CLI launcher → Minecraft HTTP interface: cleans world entities
run.py - Simulation controller → Settlement state: updates state
src/simulation.py - Simulation controller → World slice loader: loads terrain
src/simulation.py - Simulation controller → Minecraft HTTP interface: renders commands
src/simulation.py - Simulation controller → Settlement chronicle: writes sign coordinates
src/simulation.py - Settlement state → Social agents: creates agents
src/states.py - Settlement state → Road segments: creates road segments
src/states.py - Settlement state → Settlement nodes: tracks nodes
src/states.py - Social agents → Pathfinding: searches routes
src/agent.py - Social agents → Block manipulation: performs block actions
src/agent.py - Social agents → Settlement state: updates occupancy
src/agent.py - Settlement state → Pathfinding: maintains connectivity
src/states.py - Settlement state → Building schemes: uses building schemes
src/states.py - Building schemes → Schematic assets: loads designs
- Building schemes → Minecraft HTTP interface: places blocks
src/scheme_utils.py - World slice loader → Packed block data: decodes block data
http_framework/worldLoader.py - World slice loader → Running Minecraft: requests chunk data
http_framework/worldLoader.py - Minecraft HTTP interface → Running Minecraft: reads and modifies world
http_framework/interfaceUtils.py - Settlement chronicle → Minecraft HTTP interface: writes books and signs
src/chronicle.py - Settlement chronicle → CLI launcher: reads output settings
src/chronicle.py - World rules → Social agents: defines agent rules
src/utils.py - World rules → Settlement state: defines block types
src/states.py