Repository navigation
API World Generation
Lua API / World generation
BetaMoon world generation uses declarations: scripts register reusable content during initialization, and Minecraft generates chunks using those declarations. Lua callbacks do not run once per block or placement. The world seed, stable registration keys, chunk position, and local element keys provide deterministic random choices.
Changes affect terrain generated after the declaration changes. They do not rewrite blocks in existing chunks. Regional structures are the exception in one useful sense: BetaMoon saves their chosen multi-chunk plan and completes its remaining parts as the relevant chunks become available.
- A feature describes what may be placed, such as a tree, ore vein, or local structure.
- A placement decides where and how often a feature is attempted and which conditions must pass.
- A biome source decides where keyed biomes occur. Biomes can provide a surface and biome-scoped placements.
- A surface replaces the top layers of terrain for a biome before ordinary feature placement.
- A regional structure assembles registered local structures into a persistent multi-chunk layout.
Use stable keys for declarations whose generated results should remain reproducible. Put registrations in mod initialization code, not in action callbacks.
| Reference | Covers |
|---|---|
| Features and placements | Reusable features, scheduled placement rules, direct placement, previews, and rejection reasons. |
| Trees | Procedural, vanilla-adapter, and structure-backed tree features. |
| Local structures | Registering, transforming, exporting, and placing a structure. |
| Structure documents | Palettes, blocks, markers, processing order, validation, and links to the detailed format guides. |
| Structure geometry | Compact primitives such as fills, shells, lines, cylinders, and voxel maps. |
| Structure composition | Templates, transforms, repeats, choices, and conflict policies. |
| Structure processors | Deterministic replacement, decay, erosion, deposit, selectors, and protected cells. |
| Lua structures | Authoring the same structure model with Lua tables or the builder API. |
| Structure inventory loot | Fixed and randomized inventory contents in structures. |
| Structure terrain placement | Surface sampling, rigid fitting, foundations, terraces, conforming paths, excavation, and site checks. |
| Regional structures | Deterministic multi-chunk structures assembled from local templates. |
| Surfaces | Reusable deterministic top-to-bottom surface layer stacks. |
| Biomes and biome sources | Biome identity, decorators, weather, spawns, surfaces, and climate selection. |
| Ores | Ore generation rules, placement limits, lookup, and overrides. |
The World content debug export lists declarations, ordering, selected biome sources, and generation diagnostics. It is useful when a declaration loads successfully but does not appear where expected.
- Installation
- Install scripts
- Getting started
- VS Code and LuaLS
- Examples
- Reload and compatibility
- Troubleshooting
- Changelog
Scripts and shared values
- Script lifecycle
- Packaged Lua mods
- Modules
- References and stacks
- Queries
- Overrides
- Minecraft constants
- Chat and positions
- Structured data
- Script configuration
- Particles
Blocks and items
- Multiblocks
- Blocks
- Block state and placement
- Block shapes and rendering
- Block callbacks
- Block ticks and redstone
- Items
- Fluids
- Item callbacks
- Tools and armor
- Materials
- Textures
Entities
- Entities
- Entity access and movement
- Entity lifecycle and data
- Entity health and loot
- Entity inventories and relationships
- Projectiles and pickups
- Entity presentation and sounds
- Living entities and AI
- Entity parts and sensors
Assets and audio
- Assets
- Models and animations
- Built-in Minecraft models
- Model appearances
- Blockbench workflow
- Audio
- Texture-pack overrides
Events and world actions
World generation
World systems
Inventories and screens
Recipes