The most fundamental operation in cubiomes is asking “what biome is at this coordinate?” You set up a generator once for the target Minecraft version, apply a world seed and dimension, then callDocumentation 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.
getBiomeAt to get a numeric biome ID. The full setup-apply-query cycle costs nanoseconds per call at scale=4 and a little more at scale=1, making tight seed-search loops practical.
Setting up the generator
Before querying any biome you must callsetupGenerator to allocate and configure the internal state for a specific Minecraft version. You then call applySeed before every seed change — this is cheap and does not reallocate memory.
setupGenerator takes three arguments:
| Parameter | Type | Description |
|---|---|---|
g | Generator * | Pointer to an uninitialised Generator struct you own |
mc | int | Minecraft version constant (e.g. MC_1_18, MC_1_21) |
flags | uint32_t | Optional flags: 0, LARGE_BIOMES, NO_BETA_OCEAN, FORCE_OCEAN_VARIANTS |
applySeed takes:
| Parameter | Type | Description |
|---|---|---|
g | Generator * | Previously initialised generator |
dim | int | Dimension: DIM_OVERWORLD (0), DIM_NETHER (-1), DIM_END (+1) |
seed | uint64_t | 64-bit world seed |
Querying a single position
getBiomeAt returns the integer biome ID at a scaled position, or -1 on failure.
| Parameter | Meaning |
|---|---|
scale=1 | Block coordinates — one sample per block |
scale=4 | Biome coordinates — one sample per 4 blocks (the native resolution of biome data) |
For Minecraft 1.18 and later, biome generation is fully three-dimensional. The
y coordinate matters: underground biomes like lush_caves (175) and deep_dark (183) occupy specific vertical ranges. For a surface check, use y=63 (roughly sea level) with scale=1 or y=15 with scale=4.For versions up to 1.17 the generator uses a 2D layer stack and the y value is ignored.Complete example: finding a mushroom fields seed
The following program is taken directly from the cubiomes README. It iterates seeds starting from 0 until it finds one where block position (0, 63, 0) ismushroom_fields.
Workflow overview
Include generator.h
#include "generator.h" pulls in the Generator struct, setupGenerator, applySeed, getBiomeAt, and all biome ID constants from biomes.h.Initialise the generator
Call
setupGenerator(&g, MC_VERSION, flags) once per program run. The flags parameter is 0 for standard worlds; pass LARGE_BIOMES to match a Large Biomes world type.Apply each seed
Call
applySeed(&g, DIM_OVERWORLD, seed) for every seed you want to test. This is fast — it seeds internal PRNGs without re-allocating.Query the biome
Call
getBiomeAt(&g, scale, x, y, z) and compare the result against a BiomeID constant.Common biome IDs
The full list is inbiomes.h. Below are the most frequently targeted biomes.
| Constant | ID | Notes |
|---|---|---|
ocean | 0 | Default ocean |
plains | 1 | |
desert | 2 | |
forest | 4 | |
taiga | 5 | |
swamp | 6 | Required for Swamp Huts |
mushroom_fields | 14 | Rarest overworld biome |
jungle | 21 | Required for Jungle Temples |
dark_forest | 29 | Required for Woodland Mansions |
snowy_taiga | 30 | |
giant_tree_taiga | 32 | |
savanna | 35 | |
badlands | 37 | |
warm_ocean | 44 | 1.13+ |
deep_ocean | 24 | Required for Ocean Monuments |
lush_caves | 175 | Underground, 1.17+ |
deep_dark | 183 | Underground, 1.19+ |
mangrove_swamp | 184 | 1.19+ |
cherry_grove | 185 | 1.20+ |
pale_garden | 186 | 1.21 Winter Drop |
Version constants
Version constants
The
MCVersion enum in biomes.h defines one constant per supported release. Use the short alias (e.g. MC_1_18) which maps to the latest patch of that major release.Generate biomes for an area
Use
genBiomes with a Range to generate an entire region at once — much faster than calling getBiomeAt per cell.Filter seeds by biome requirements
Use
checkForBiomes and BiomeFilter to reject seeds that cannot contain a required set of biomes.