Skip to main content

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.

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 call 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 call setupGenerator 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.
#include "generator.h"

Generator g;
setupGenerator(&g, MC_1_18, 0);   // version, flags
applySeed(&g, DIM_OVERWORLD, seed);
setupGenerator takes three arguments:
ParameterTypeDescription
gGenerator *Pointer to an uninitialised Generator struct you own
mcintMinecraft version constant (e.g. MC_1_18, MC_1_21)
flagsuint32_tOptional flags: 0, LARGE_BIOMES, NO_BETA_OCEAN, FORCE_OCEAN_VARIANTS
applySeed takes:
ParameterTypeDescription
gGenerator *Previously initialised generator
dimintDimension: DIM_OVERWORLD (0), DIM_NETHER (-1), DIM_END (+1)
seeduint64_t64-bit world seed

Querying a single position

getBiomeAt returns the integer biome ID at a scaled position, or -1 on failure.
int scale = 1; // scale=1: block coordinates, scale=4: biome coordinates
int x = 0, y = 63, z = 0;
int biomeID = getBiomeAt(&g, scale, x, y, z);
ParameterMeaning
scale=1Block coordinates — one sample per block
scale=4Biome 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) is mushroom_fields.
// check the biome at a block position
#include "generator.h"
#include <stdio.h>

int main()
{
    // Set up a biome generator that reflects the biome generation of
    // Minecraft 1.18.
    Generator g;
    setupGenerator(&g, MC_1_18, 0);

    // Seeds are internally represented as unsigned 64-bit integers.
    uint64_t seed;
    for (seed = 0; ; seed++)
    {
        // Apply the seed to the generator for the Overworld dimension.
        applySeed(&g, DIM_OVERWORLD, seed);

        // To get the biome at a single block position, we can use getBiomeAt().
        int scale = 1; // scale=1: block coordinates, scale=4: biome coordinates
        int x = 0, y = 63, z = 0;
        int biomeID = getBiomeAt(&g, scale, x, y, z);
        if (biomeID == mushroom_fields)
        {
            printf("Seed %" PRId64 " has a Mushroom Fields biome at "
                "block position (%d, %d).\n", (int64_t) seed, x, z);
            break;
        }
    }

    return 0;
}
Running this outputs:
Seed 262 has a Mushroom Fields biome at block position (0, 0).

Workflow overview

1

Include generator.h

#include "generator.h" pulls in the Generator struct, setupGenerator, applySeed, getBiomeAt, and all biome ID constants from biomes.h.
2

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.
3

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.
4

Query the biome

Call getBiomeAt(&g, scale, x, y, z) and compare the result against a BiomeID constant.
5

Compile with -fwrapv

Link with libcubiomes.a or -lcubiomes and always pass -fwrapv to enforce two’s-complement signed overflow, which mirrors Java’s arithmetic.
gcc find_biome_at.c libcubiomes.a -fwrapv -lm

Common biome IDs

The full list is in biomes.h. Below are the most frequently targeted biomes.
ConstantIDNotes
ocean0Default ocean
plains1
desert2
forest4
taiga5
swamp6Required for Swamp Huts
mushroom_fields14Rarest overworld biome
jungle21Required for Jungle Temples
dark_forest29Required for Woodland Mansions
snowy_taiga30
giant_tree_taiga32
savanna35
badlands37
warm_ocean441.13+
deep_ocean24Required for Ocean Monuments
lush_caves175Underground, 1.17+
deep_dark183Underground, 1.19+
mangrove_swamp1841.19+
cherry_grove1851.20+
pale_garden1861.21 Winter Drop
Use biome2str(mc, biomeID) from util.h to get the resource-ID name of any biome at runtime (e.g. "minecraft:mushroom_fields"). This is useful for debug output when scanning many seeds.
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.
MC_1_7, MC_1_8, MC_1_9, MC_1_10, MC_1_11, MC_1_12,
MC_1_13, MC_1_14, MC_1_15, MC_1_16, MC_1_17,
MC_1_18, MC_1_19, MC_1_20, MC_1_21

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.

Build docs developers (and LLMs) love