Structure generation in cubiomes mirrors how Minecraft itself works: first the game picks a candidate block position for a structure somewhere in a grid region, then it checks whether the surrounding biomes actually permit that structure to spawn. You replicate this two-stage process withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Cubitect/cubiomes/llms.txt
Use this file to discover all available pages before exploring further.
getStructurePos followed by isViableStructurePos. The first call costs nanoseconds and depends only on the lower 48 bits of the seed, making it practical to scan billions of seeds before ever touching the more expensive biome generator.
How region-based generation works
Minecraft divides the world into a grid of regions — usually 32×32 chunks — and makes one generation attempt somewhere inside each region. The attempt position is determined by the structure type, the region coordinates(regX, regZ), and the lower 48 bits of the world seed. The top 16 bits of the seed have no effect on structure positions.
Because the dependency on region coordinates is linear, you can translate any structure to a different part of the world by transforming the 48-bit seed with moveStructure.
Structure types
Includefinders.h to access the StructureType enum.
| Constant | Notes |
|---|---|
Feature | Pre-1.13 temple generation attempts |
Desert_Pyramid | |
Jungle_Temple | Also aliased as Jungle_Pyramid |
Swamp_Hut | Required biome: swamp |
Igloo | |
Village | |
Ocean_Ruin | |
Shipwreck | |
Monument | Ocean Monument; large structure distribution |
Mansion | Woodland Mansion; large structure distribution |
Outpost | Pillager Outpost |
Ruined_Portal | |
Ruined_Portal_N | Nether-side Ruined Portal |
Ancient_City | 1.19+ |
Treasure | Buried Treasure |
Mineshaft | Use getMineshafts() instead of getStructurePos() |
Desert_Well | |
Geode | |
Fortress | Nether Fortress |
Bastion | Bastion Remnant |
End_City | |
End_Gateway | |
End_Island | |
Trail_Ruins | 1.20+ |
Trial_Chambers | 1.21+ |
Finding a structure position
getStructurePos returns the block position of the generation attempt in a given region, or zero if no valid attempt exists for that region and seed.
| Parameter | Description |
|---|---|
structureType | One of the StructureType enum values |
mc | Minecraft version constant (e.g. MC_1_18) |
seed | World seed — only the lower 48 bits are used |
regX, regZ | Region coordinates, not chunk or block coordinates |
pos | Output Pos struct written on success |
Confirming biome viability
isViableStructurePos performs a biome check near the candidate block position to determine whether the structure would actually generate there.
applySeed. The function temporarily modifies the generator state but restores it before returning. Pass flags = 0 for most structure types; for villages you can use the flags to specify a biome variant.
Complete example: Pillager Outpost at the origin
The following program searches for a seed where a Pillager Outpost generates within the origin chunk (blocks 0–15 in both axes).Scan lower 48-bit seeds
The outer loop iterates
lower48 from 0 upward. For each value, getStructurePos checks whether the structure has a generation attempt at all in region (0, 0). This is fast enough to iterate millions of values per second.Filter by position
The example then discards attempts that fall outside the origin chunk (
p.x >= 16 || p.z >= 16). Adjust this predicate for your target location.Relocating structures with moveStructure
Because the position formula has a linear dependency on region coordinates, you can shift a 48-bit seed so that its structures move by a region offset(dregX, dregZ):
moveStructure to translate the whole cluster anywhere in the world.
moveStructure operates on 48-bit seeds and returns a 48-bit result. Combine the result with your chosen upper 16 bits before using it as a full world seed.Getting the structure configuration
UsegetStructureConfig to retrieve the version-specific StructureConfig for a given type. The config holds the structure’s salt, region size, chunk range, dimension, and rarity.
False positives in 1.18+
Find quad-structure seeds
Use
searchAll48 and isQuadBase to locate seeds where four structures cluster within a single 128-block AFK sphere.Filter seeds by biome requirements
Combine structure searches with
checkForBiomes to require specific biomes in the same world.