The finders API locates Minecraft structures and world features from a world seed without simulating the full game. Structure positions depend only on the lower 48 bits of the world seed and the region coordinates, so most lookups are extremely fast. Biome checks are layered on top when you need to verify that conditions are met for a structure to actually spawn.Documentation 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.
Key structs
StructureConfig
Holds the positioning parameters for a structure type in a given Minecraft version.
| Field | Type | Description |
|---|---|---|
salt | int32_t | Additive seed constant unique to this structure type. |
regionSize | int8_t | Side length of the placement grid in chunks. |
chunkRange | int8_t | Maximum chunk offset within a region for the attempt. |
structType | uint8_t | StructureType enum value identifying the structure. |
dim | int8_t | Dimension: 0 Overworld, -1 Nether, +1 End. |
rarity | float | Generation probability (structure-specific; may be unused). |
StrongholdIter
Iteration state for walking through stronghold positions in generation order.
StructureType enum
| Constant | Notes |
|---|---|
Feature | Temple generation attempts (pre-1.13). |
Desert_Pyramid | |
Jungle_Temple | Alias: Jungle_Pyramid |
Swamp_Hut | |
Igloo | |
Village | |
Ocean_Ruin | |
Shipwreck | |
Monument | |
Mansion | |
Outpost | |
Ruined_Portal | |
Ruined_Portal_N | Nether ruined portal. |
Ancient_City | |
Treasure | Buried treasure. |
Mineshaft | |
Desert_Well | |
Geode | |
Fortress | |
Bastion | |
End_City | |
End_Gateway | |
End_Island | |
Trail_Ruins | |
Trial_Chambers |
Finding structure positions
getStructureConfig
sconf with the positioning configuration for the given structure type and MC version. Returns non-zero on success; returns zero if the version does not support the structure type.
A
StructureType enum value.Minecraft version constant.
Output struct to populate.
getStructurePos
(regX, regZ). Only the lower 48 bits of seed are used. Returns zero if the region produces no valid attempt for this type; returns non-zero otherwise. Use isViableStructurePos to confirm biome requirements are met.
A
StructureType enum value.Minecraft version constant.
World seed (only the lower 48 bits are relevant).
Region X coordinate (region size depends on structure type).
Region Z coordinate.
Output block position.
getFeaturePos (inline)
StructureConfig.
getFeatureChunkInRegion (inline)
getLargeStructurePos (inline)
getMineshafts
(chunkX, chunkZ) with size (chunkW, chunkH). Writes up to nout positions to out. Returns the total count of chunks with mineshafts in the area.
Minecraft version.
World seed.
X origin in chunk coordinates.
Z origin in chunk coordinates.
Width of the search area in chunks.
Height of the search area in chunks.
Output buffer for positions. Pass
NULL to count only.Maximum number of positions to write to
out.isSlimeChunk (inline)
(chunkX, chunkZ) for the given world seed.
World seed.
Chunk X coordinate.
Chunk Z coordinate.
Strongholds and spawn
initFirstStronghold
sh is non-null it is initialized for subsequent iteration with nextStronghold. Returns the approximate block position.
Iterator to initialize. Pass
NULL to get only the first position.Minecraft version.
Lower 48 bits of the world seed.
nextStronghold
NULL for g on MC 1.19.3+ to iterate approximate positions without biome checks. Returns the number of further strongholds after this one.
Iterator initialized by
initFirstStronghold.Overworld generator with the world seed applied. Pass
NULL for approximate-only iteration on 1.19.3+.getSpawn
Seeded Overworld generator.
estimateSpawn
rng output captures the random state after the search.
Seeded Overworld generator.
Optional output for the RNG state. Pass
NULL to ignore.locateBiome
(x, y, z). This is the algorithm used internally for spawn and stronghold placement. It is accurate but slow.
Overworld generator.
Search origin X (block coordinate).
Search origin Y (block coordinate).
Search origin Z (block coordinate).
Half-side of the search square in blocks.
Bitset of valid biome IDs 0–63.
Bitset of valid biome IDs 192–255.
Output RNG state. Initialize with
setSeed(rng, world_seed) before calling. Pass NULL to ignore.Output count of valid positions sampled. Pass
NULL to ignore.getShadow (inline)
seed but with inverted biome distribution.
Original world seed.
Validating structure positions
isViableStructurePos
(blockX, blockZ) to determine whether a structure of structType can spawn there. The generator is temporarily modified during the call and restored on return. Returns non-zero if the position is viable.
A
StructureType enum value.Generator initialized for the correct version, dimension, and seed.
Block X coordinate (from
getStructurePos).Block Z coordinate.
Optional structure-specific flags (e.g. biome variant for villages). Pass
0 for defaults.isViableFeatureBiome
biomeID can generate the specified structure type in the given version.
Minecraft version.
A
StructureType enum value.Biome ID to test.
isViableStructureTerrain
Desert_Pyramid, Jungle_Temple, and Mansion. Returns non-zero if the terrain could support the structure.
Structure type to check.
1.18 Overworld generator with seed applied.
Block X coordinate.
Block Z coordinate.
Structure properties
getVariant
Output variant data.
Structure type.
Minecraft version.
World seed.
Block X coordinate of the structure.
Block Z coordinate of the structure.
Biome at the structure position.
getEndCityPieces
pieces buffer must hold at least END_CITY_PIECES_MAX (421) elements. Returns the number of pieces generated.
Output buffer of at least
END_CITY_PIECES_MAX elements.World seed.
Chunk X coordinate of the End City.
Chunk Z coordinate of the End City.
getFortressPieces
n structural pieces of a Nether Fortress. A buffer of ~400 is sufficient in practice. Returns the number of pieces generated.
Output buffer.
Maximum number of pieces to generate.
Minecraft version.
World seed.
Chunk X coordinate of the Fortress origin.
Chunk Z coordinate.
getFixedEndGateways
src. These are the gateways that appear each time the Ender Dragon is defeated.
Minecraft version.
World seed.
Output array of 20 positions.
getHouseList
HOUSE_NUM (9) for houses. Returns the random seed state after the computation.
Output array of length
HOUSE_NUM (9) indexed by house-type enum.World seed.
Chunk X coordinate of the village origin.
Chunk Z coordinate.
Seed filters
setupBiomeFilter
BiomeFilter from lists of required, excluded, and match-any biome IDs. Biomes must not appear in more than one list. Pass NULL and 0 for unused lists.
Output filter to populate.
Minecraft version.
Generator flags (e.g.
BF_APPROX for aggressive pre-filtering).Array of biome IDs that must all be present. Pass
NULL if none.Length of
required.Array of biome IDs that must not be present. Pass
NULL if none.Length of
excluded.Array of biome IDs where at least one must be present. Pass
NULL if none.Length of
matchany.checkForBiomes
r and checks whether it satisfies filter. Returns 0 if the filter fails, 1 if generation completed and passed, or 2 if it passed with incomplete generation. The generator is left in a partially initialized state after the call; re-apply a seed before further use.
Generator set up for the correct version (seed applied internally).
Working buffer and biome output. Pass
NULL to skip output.Range to check.
Dimension:
0 Overworld, -1 Nether, +1 End.World seed.
Filter produced by
setupBiomeFilter.Abort flag. Set to non-zero from another thread to interrupt. Pass
NULL if unused.checkForBiomesAtLayer
checkForBiomes for a LayerStack (Overworld, MC ≤ 1.17). The layer stack is modified in place.
Layered generator (will be modified).
Generation entry point.
Output buffer or
NULL.World seed.
X origin of the area.
Z origin of the area.
Width.
Height.
Biome filter.
monteCarloBiomes
r and checks that at least coverage fraction of them satisfy eval. Uses a statistical confidence level to bound the number of samples. Returns non-zero if the coverage threshold is met.
Seeded biome generator.
Region to sample.
Random seed for sampling positions.
Minimum fraction of successful evaluations, in [0, 1].
Statistical confidence level, e.g.
0.95 for 95%.Evaluation callback: returns
1 for success, 0 for failure, -1 to skip, or any other value to abort.User data passed to
eval.getBiomeCenters
match within the area r (requires scale = 4, sy = 1). Returns the number of entries written.
Output array of up to
nmax center positions.Output array of biome region sizes. Pass
NULL to ignore.Maximum number of output entries.
Initialized Overworld generator.
Area to examine (
scale = 4, sy = 1).Biome ID to search for.
Minimum biome region size to report.
Border tolerance in scaled units.
Abort flag. Pass
NULL if unused.Biome noise finders (1.18+)
getParaRange
(x, z, w, h) at 1:4 scale. Results are written to pmin and pmax (nullable). Returns non-zero on error.
Climate noise parameter to evaluate.
Output minimum. Pass
NULL to skip.Output maximum. Pass
NULL to skip.X origin.
Z origin.
Width.
Height.
User data for the optional callback.
Optional callback called at each iteration. Return non-zero to abort.
getBiomeParaExtremes
Minecraft version (1.18+).
getBiomeParaLimits
id can generate, as 12 consecutive integers.
Minecraft version (1.18+).
Biome ID.
getPossibleBiomesForLimits
ids for every biome that can generate within the given set of climate parameter limits.
Output array indexed by biome ID. Non-zero means the biome is possible.
Minecraft version (1.18+).
Min/max pairs for temperature, humidity, continentalness, erosion, depth, and weirdness.
canBiomeGenerate
biomeID may generate at the given layer entry point.
Layer ID (e.g.
L_BIOME_256, L_VORONOI_1).Minecraft version.
Generator flags.
Biome ID to test.
getAvailableBiomes
mL (IDs 0–63) and mM (IDs 128–191) with all biomes that can generate in the given version and layer.
Output bitfield for biome IDs 0–63.
Output bitfield for biome IDs 128–191.
Layer ID. Also supports
L_OCEAN_TEMP_256 and 1.18+ (where layerId is ignored).Minecraft version.
Generator flags.