Skip to content

API reference / @jsprismarine/worldgen

@jsprismarine/worldgen ​

Join the Discord Servernpm

Java Edition's terrain stack in TypeScript: the two random sources, the five noise kinds, all 44 density function operators, the noise router, aquifers, ore veins and a chunk-shaped sampler. Everything is read from Mojang's published worldgen/* JSON at load time, and everything is pinned to Java Edition 26.3.

ts
import { ChunkSampler, RandomState, WorldgenData } from '@jsprismarine/worldgen';

const data = new WorldgenData({ densityFunctions, noises, noiseSettings });
const settings = data.settings('minecraft:overworld');
const state = new RandomState(data, 1234n, settings);

const sampler = new ChunkSampler(state, { chunkX: 3, chunkZ: -5 });
sampler.blockAt(48, 4, -80); // { state: 'minecraft:water', scheduleFluidUpdate: false }

Block states come out as Java identifiers. Translating them to Bedrock is @jsprismarine/mapping's job, so nothing here names two editions.

Parity ​

Every expected value in the test suite comes from Mojang's own classes. utils/oracle/ compiles a small Java program against the pinned 26.3 server jar and writes vectors/*.json; the tests read those and compare exactly, not within a tolerance. What matches today:

StageVectorsResult
XoroshiroRandomSource, LegacyRandomSource6 seeds, both sources, every methodexact
Perlin, simplex, smeared Perlin, normal, old blended noise6 positions eachexact
All eight noise router slots, all seven dimensions6 positions eachexact
All six aquifer functions, the three dimensions that have them6 positions eachexact
Overworld chunk columns with aquifers applied9 columns, 384 blocks eachexact

Refresh the vectors with pnpm --filter @jsprismarine/worldgen run vectors. The command prepares the pinned jar automatically and needs a JDK 25 or newer to compile and run the Java oracle.

26.3 computes the whole density and noise stack in single precision. This package rounds through Math.fround at every point Java narrows a value, which is why the comparisons above are exact rather than approximate. The coordinate arithmetic inside the noise functions stays double, as it is in Java.

Why not deepslate ​

The plan's decision 6 made misode/deepslate the default dependency for density functions, noise, randoms and biome lookup. deepslate 0.27.2 (MIT, published 2026-09-27) does track 26.3: it reads the new base_octave and amplitude_modifiers noise schema, seeds octaves from fromHashOf("octave_<index>"), and knows all 44 density function types plus the aquifers block. The decision was reasonable. Four things measured against the real jar changed it.

  • Precision. 26.3 computes Noise.get, DensitySampler.sampleValue and DensityBuffer in float. deepslate's noise and density paths are double throughout, and only its cubic spline rounds. Sampling one Perlin octave both ways against Java's own output: the single-precision form matched all six golden positions exactly, the double form matched none of them, by up to 1.4e-7. That is small, and it is still the difference between "the same world" and "nearly the same world", which is the whole claim this package exists to support.
  • Two random sources deviate. XoroshiroRandom.nextLong tests value > 2^63 where Java's signed wrap is >= 2^63, so the single most negative long comes back positive. LegacyRandom.nextDouble is next(30) * 2^-30; Java's is ((next(26) << 27) + next(27)) * 2^-53. Neither source has nextGaussian, and the all-zero Xoroshiro state is not substituted. Terrain does not touch nextGaussian, but carvers and features do.
  • An unknown type evaluates to zero. DensityFunction.fromJson returns Constant.ZERO for a type it does not recognize, so the next schema change arrives as different terrain rather than as an error. This package throws on an unknown type, a missing field and a reference cycle.
  • The import is wide. deepslate/worldgen reaches 118 modules and all three dependencies, gl-matrix, md5 and pako, because worldgen imports core, which imports the shared math.

NormalNoise.createForLegacyNetherBiome also carries a typo, amplitudes: for amplitude: in the second stack, which drops the value factor from the nether's temperature and vegetation noises.

deepslate stays the reference this implementation was read against, and it is the right thing to reach for when a 1.21-shaped pack or a browser-side preview is the problem. For 26.3 terrain intended to match Java block for block, the precision gap alone is disqualifying.

What it implements ​

Randoms. XoroshiroRandomSource and LegacyRandomSource with nextInt, nextInt(bound), nextLong, nextBoolean, nextFloat, nextDouble, nextGaussian, fork and forkPositional; XoroshiroPositionalRandomFactory and LegacyPositionalRandomFactory with at, fromHashOf and fromSeed; the Stafford seed mixing, Java's position hash and String.hashCode.

Noise. PerlinNoise, SmearedPerlinNoise, SimplexNoise, the flat NoiseStack that replaced the old octave list, NormalNoise over the 26.3 parameter schema, the legacy nether octave chain, and old_blended_noise with its three fractal Brownian motion stacks.

Density functions, all 44 types 26.3 registers:

GroupTypes
Sourcesconstant, gradient, noise, shift, shift_a, shift_b, old_blended_noise, end_outer_islands, distance_to_point
Chunk contextbeardifier, blend_alpha, blend_offset, blend_density
Unaryabs, square, cube, sqrt, half_negative, quarter_negative, reciprocal, negate, squeeze, log, sign
Roundingfloor, round, ceil, truncate
Binaryadd, sub, mul, div, min, max, pow
Selectionclamp, lerp, range_choice, interval_select, spline
Structuralcache, interpolated, slice, find_top_surface

The vanilla 26.3 data uses 34 of them; the other 10 are available to data packs.

Trees are parsed once, references resolved eagerly, and each tree compiled once. The closure compiler is the default. RandomState also accepts { generatedFunctions: true } as its optional fourth argument to prototype JavaScript evaluators for supported arithmetic nodes; stateful and unsupported nodes stay closures, and hosts that reject dynamic code fall back to closures. A cache node gets a memo slot in the SampleContext, and an interpolated node records its cell corners there, which is what makes a full overworld chunk 0.63 seconds instead of 16.7.

The prototype stays opt-in because it has no qualifying quiet-host result yet. Run pnpm --filter @jsprismarine/worldgen run bench 5 to compare the closure and generated evaluators. The benchmark uses seed 1234, four fixed overworld chunks, two warmups, seven timed repetitions per process, and five interleaved fresh-process rounds. It checks output stability between process rounds and verifies the block digest across the closure, generated, and cell-skip arms. It reports the runtime, CPU, memory, load averages, median and range for chunk time, compilation time, retained heap after garbage collection, generated source size, and closure fallbacks. It marks the run quiet only when the one-minute load average at both ends is at most one quarter of the logical CPU count, with a minimum limit of one.

The benchmark fills four overworld chunks; it is not broad-corpus evidence. The density compiler test compares Float32 output bits for every checked-in density function and every router and aquifer root across seeded coordinates and interpolation boundaries. Java goldens and the terrain parity row remain separate checks.

Settings and the router. parseNoiseGeneratorSettings reads a worldgen/noise_settings document into the eight router slots (temperature, vegetation, continents, erosion, depth, ridges, chunk_surface_level, final_density), the six aquifer functions, the vertical extent, the default block and fluid, the sea level, the material rule reference and the random source flag.

1.21's router had fifteen slots. In 26.3 the four aquifer entries moved into the aquifers block, the three vein entries moved into the minecraft:ore_vein material rule, and initial_density_without_jaggedness became chunk_surface_level. Code written against the fifteen-slot shape does not load 26.3 data.

Aquifers and ore veins. NoiseBasedAquifer is the jittered 16 by 12 by 16 cell grid with its barrier pressure, floodedness thresholds and lava rule. createGlobalFluidPicker builds the dimension-wide fluid surface. compileOreVeinRule implements the minecraft:ore_vein rule with its three draws in Java's order.

Chunk sampling. ChunkSampler samples final_density per block and runs the aquifer over the result, for one block, one column or a whole 16 by 16 chunk. column and fill go top-down; forEachCellBlock walks the chunk one interpolation cell at a time, which is what a generator filling a whole chunk should use. A sample answers the same in either order, so the choice is only about how long an interpolated node can hold its eight cell corners: a column walk leaves a cell every eight blocks, a cell walk every 128.

Dimensions. Five parsers read the documents that bind a dimension to a generator, all with path-qualified errors. parseDimensionType reads a dimension_type file in its 26.3 shape (has_fixed_time, skybox, cardinal_light, attributes), applies the wiki's defaults for the absent fields and keeps attributes as a map of raw JSON. parseLevelStem reads a stem's type and generator; a minecraft:noise generator keeps its settings id and parses its biome_source, a minecraft:flat generator parses its layers or keeps the flat_level_generator_preset id it names for a generator factory to resolve, minecraft:debug has no fields, and an unknown kind keeps { type, settings } for a generator factory to read. parseWorldPreset reads a worldgen/world_preset file into a map of stems and requires minecraft:overworld. parseFlatGeneratorSettings reads the settings object of a flat generator or a flat_level_generator_preset, with Java's height per layer rather than this server's size. parseBiomeSource builds a FixedBiomeSource, CheckerboardBiomeSource, MultiNoiseBiomeSource or TheEndBiomeSource from a stem's biome_source; a multi_noisepreset resolves through the parameter lists the caller passes, keyed by multi_noise_biome_source_parameter_list id, because the datapack's two list files only name the preset and the climate boxes live in the data generator's reports/biome_parameters. Nothing here decides what a dimension type means to a Bedrock client; the server joins the parsed type with @jsprismarine/mapping's overlay, as docs/data-driven/dimensions.md describes.

Seams left open ​

The terrain core is the bottom of the stack. Four stages sit on top of it, and each has an injection point rather than a stub:

  • The surface pass reads NoiseGeneratorSettings.materialRule, which this package resolves to an identifier and does not interpret. It needs ChunkSampler.sample for chunk_surface_level, the compiled minecraft:ore_vein placer from compileOreVeinRule, and a per-column biome getter. Java's material_rule and material_condition registries are its input.
  • The biome source reads the six climate slots of the router through RandomState.sampler. Multi-noise lookup, the parameter list and the biome registry belong to it.
  • Features and structures take RandomState.randomFactory(name) for their positional randoms. Nothing in this package draws from a sequential stream, so a feature stage can be added without disturbing terrain.
  • Carvers run between the chunk fill and the surface pass. ChunkSampler.blockAt and ChunkSampler.column return plain values rather than writing into a chunk, so a carver can sit between them and whatever stores the result.
  • The world blender and the structure beard are SampleContext.blendAlpha, SampleContext.blendOffset, SampleContext.blendDensity and SampleContext.beardifier. They default to the values Java uses outside a blending region, so terrain is correct without them.

Known gaps ​

  • The scalar sampler remains the default. The opt-in volume evaluator and its current measurements are described in Volume density prototype; it is slower on the measured overworld graph and only handles a subset of node types. A chunk's fill reads nothing outside itself, so a server can also raise throughput by generating several chunks at once.
  • The random sources use BigInt for their 64-bit state. That is exact and slow, and it is the reason PositionalRandomFactory.at is the most expensive call in the ore vein stage.
  • Nothing here reads a data pack. WorldgenData takes the three registries as maps of parsed JSON, which is what @jsprismarine/packs produces.

Volume density prototype ​

ChunkSampler can evaluate final density into typed arrays one interpolation cell at a time:

ts
const sampler = new ChunkSampler(state, {
    chunkX: 3,
    chunkZ: -5,
    useVolumeDensity: true
});

The option affects forEachCellBlock, which is the chunk-fill path. It defaults to false, so fill, column and other callers keep using the scalar evaluator. The volume evaluator writes Float64Array results in x-fastest, then z, then y order. A sampler reuses its output and intermediate buffers across cells.

The volume compiler evaluates constants, unary arithmetic, add, sub, min, max, and clamp over arrays. It also handles mul and div when either operand is constant. All other node types, including noise, gradient, cache, interpolation, spline, rounding, pow, slice, and selection nodes, use the existing scalar compiler. Dynamic-by-dynamic mul and div also stay scalar because they can skip their right operand when the left value is zero.

RandomState caches each compiled volume plan for that state. Every call to volumeSampler, and every ChunkSampler using useVolumeDensity, gets its own mutable workspace. Keep each evaluator and SampleContext exclusive to one active chunk at a time. The scalar SampleContext caches remain per chunk; the volume workspace stores intermediate values for one cell and retains its largest capacity until that sampler is discarded. Cells larger than 4,096 blocks use the scalar path to cap per-evaluator memory.

Run pnpm --filter @jsprismarine/worldgen run bench:density-volume to compare the overworld final_density graph and a whole chunk fill. It checks scalar and volume digests, then runs the complete checked-in Java chunk corpus through forEachCellBlock: one overworld chunk with nine captured columns, each 384 blocks tall. Every captured state is compared with the Java vector, and the full 98,304-block digest is compared between scalar and volume evaluation. It repeats that chunk independently with 0, 1, 2, and 4 worker threads and fails if any digest changes. The worker runs check evaluator isolation and deterministic output; they do not measure chunk-pool throughput. The report includes the 1-, 5-, and 15-minute load averages at the start and end, and marks the run quiet only when the 1-minute load at both points is at most one quarter of the logical CPU count, with a minimum limit of one. On Windows, where Node does not report load averages, both the availability and quiet flags are false.

Both chunk-fill arms disable proven-cell skipping so every density and aquifer call is exercised. The allocation pass runs five fresh child processes per arm with --expose-gc. It warms the sampler, forces collection before the baseline, samples V8 heap allocations at 1,024-byte intervals for one fill, then records process.memoryUsage() before and after a forced collection while the sampler remains live. The V8 heap figure is a sampled allocation estimate, not an exact allocation count. The post-GC ArrayBuffer delta measures backing storage retained by one live sampler; the post-fill snapshot may also include temporary buffers not yet collected.

On Node 26.12.1, Darwin arm64, the latest run reported host.quiet: false: the 1-minute load average was 10.43 at the start and 9.84 at the end, above the limit of 2 for this 8-CPU host. Treat these timings and allocation samples as exploratory, and rerun the command when it reports host.quiet: true. The best-of-three density timings were 18.43 ms scalar and 23.45 ms volume for 98,304 samples, or 5.33 million versus 4.19 million samples per second. Full chunk fills took 24.88 ms scalar and 31.18 ms volume. The volume plan used six instructions, three scalar fallbacks, one workspace growth, 6,144 bytes of retained intermediate arrays, and a 1,024-byte cell output buffer. Both arms produced full-chunk digest 7c1ff94d; all nine Java columns matched, with corpus digest 2be57e2e, at worker counts 0, 1, 2, and 4.

Across five memory runs, sampled JavaScript heap allocation had a median of 200,912 bytes for scalar (range 189,840–208,816) and 199,040 bytes for volume (range 174,656–207,744). Live ArrayBuffer growth after collection was 690,407 bytes scalar and 697,575 bytes volume, including the volume evaluator's additional 7,168 retained bytes. Heap used after collection grew by 113,400 bytes scalar and 103,136 bytes volume. The noisy run does not establish a performance or allocation advantage; the volume path remains opt-in, and the scalar sampler remains the default. The checked-in Java chunk corpus is limited to one chunk; the six additional full-chunk goldens extend scalar-volume digest coverage but are not additional Java captures.

The surface pass, the biomes and the carvers ​

Three stages sit on top of the terrain core. Each reads the seams the section above lists, and each is verified against Mojang's classes the same way: utils/oracle/DumpSurfaceVectors.java writes vectors/surface-*.json and vectors/biome-*.json, and the tests compare exactly.

The surface pass. SurfaceSystem.buildSurface walks a chunk column by column from the top down, counting how far each solid block sits from the opening above it and the opening below it, and applies the dimension's material rule tree. All five material_rule types and all eleven material_condition types 26.3 registers are implemented:

GroupTypes
Rulesblock, bandlands, sequence, condition, ore_vein
Conditionsbiome, noise_threshold, vertical_gradient, y_above, water, temperature, steep, not, hole, above_preliminary_surface, stone_depth

A tree is parsed once into MaterialRuleNode values and compiled once into closures bound to a MaterialRuleContext. Conditions that depend only on the column cache their answer against a per-column counter and conditions that depend on the block cache against a per-block counter, which is what keeps the surface noise at 256 samples per chunk instead of one per block. Eroded badlands pillars and frozen ocean icebergs are code rather than rules in Java, and they are code here too.

The biome sources. MultiNoiseBiomeSource holds the seven-axis climate model: six parameter ranges plus the tie-breaking offset, quantized by Java's single-precision multiply by 10000. ClimateParameterList builds the same search tree Java builds over the vanilla overworld's 7594 parameter points and answers a nearest-box query through it; findBruteForce is the linear scan the tests check it against. When two boxes are exactly as near, Java keeps the one its thread found last, so its answer depends on that thread's earlier lookups. ClimateParameterList returns the box that comes first in the tree instead, which is Java's answer for a thread with no earlier lookup. A biome then depends on the seed and the position only, whatever order chunks generate in. FixedBiomeSource, CheckerboardBiomeSource and TheEndBiomeSource cover the other three layouts.

BiomeManager is the per-block getter the surface pass needs. A biome source answers per 4 by 4 by 4 cell, and Java does not snap a block to its own cell: it picks whichever of the eight surrounding cell corners is nearest after a seeded jitter, so a biome edge wanders by a block or two. Resolving one biome per chunk instead puts the wrong block on every column the chunk's other biomes own.

The carvers. carveChunk runs the cave and canyon carvers over the 289 source chunks within eight chunks of the target, seeding each from the world seed and the source chunk position, and records the openings in a CarvingMask. Trigonometry goes through Java's 65536-entry sine table rather than Math.sin, because the two differ in the last bits and a tunnel walks a hundred steps.

carversFromNoiseBiome picks a source chunk's carver list from the biome source's cell at (chunkX * 4, 0, chunkZ * 4), the way Java's getBiomeGenerationSettingsForCarver does. It skips BiomeManager, whose jitter moves the biome at a chunk corner in about 1.5% of overworld chunks.

Parity ​

StageVectorsResult
Surface pass, whole columns9 columns in each of overworld, nether and endexact
One synthetic rule per condition type15 rules, 9 columns eachexact
Climate parameter lookup7594 overworld points, 5 nether points, 8 targets eachexact
Search tree against a brute-force scan8 oracle targets plus a 405-point grid per listidentical
Climate ties3 overworld cells, a fresh thread and a thread primed with each tied biomefresh-thread answer, whatever the history
Biome zoomer and its seed hash6 positions, 6 seedsexact
End biome source32 cells over all five end biomesexact
Carverscave and canyon, 5 chunks each, every opened blockexact
Carver selectionnoise biome at the corner of 2304 chunks, seed 1234exact

Carver paths cannot match Bedrock Edition for the same seed, because Mojang has not described Bedrock's generator (cross-edition-worldgen-parity.md section 2). The tests that look across editions check determinism and distribution instead, and their names say so. Everything above compares against Java Edition, where exact equality is the point.

Refreshing these vectors ​

utils/oracle/run.mjs builds the terrain core's vectors. The surface dumper is a second program beside it, run the same way:

sh
pnpm --filter @jsprismarine/bedrock-data run ensure:java-server
JAR=node_modules/.cache/jsprismarine/java/26.3/extracted/META-INF/versions/26.3/server-26.3.jar
javac -cp "$JAR:node_modules/.cache/jsprismarine/java/26.3/libraries/*" \
  -d /tmp/surface-dumper packages/worldgen/utils/oracle/DumpSurfaceVectors.java
java -cp "/tmp/surface-dumper:$JAR:node_modules/.cache/jsprismarine/java/26.3/libraries/*" \
  DumpSurfaceVectors "$JAR" packages/worldgen/vectors
pnpm prettier --write packages/worldgen/vectors/surface-*.json packages/worldgen/vectors/biome-*.json

Run it from inside node_modules/.cache/jsprismarine/: Mojang's logger writes a logs/ directory into the working directory.

utils/oracle/DumpClimateTies.java writes vectors/climate-ties.json the same way. It runs every lookup on a new thread, because Java keeps the previous result in a thread-local.

utils/oracle/DumpCarverBiomes.java writes vectors/carver-biomes.json and takes one argument, the output directory. Compile and run it the same way as the surface dumper.

surface-registries.json carries the material_rule, material_condition, carver, density_function, noise, noise_settings and biome climate documents straight out of the jar, so the whole suite runs with no jar present. Each document is one compact JSON string, because Prettier reformats nested JSON into one field per line and that turns the 55 density functions into 600 KB of whitespace.

Decisions ​

  • biomeClimate is a required argument of buildSurface, not an optional one. The temperature condition and the iceberg melt test read a biome's temperature and temperature_modifier. A default would make a rule tree that uses them quietly place the wrong block, which is the failure mode this package rejected deepslate over. parseBiomeClimate reads the two fields out of a worldgen/biome document, so supplying it is one line.
  • Quantized climate coordinates are numbers, not BigInt. Java holds them as long, but they never leave [-20000, 20000] and a squared distance over seven axes stays under 2^53, so the arithmetic is exact either way and numbers are far cheaper. The single-precision multiply Java applies before truncating is kept, because it moves 0.0003 from 2 to 3.
  • VerticalAnchor and WorldGenerationContext live under src/surface/. Both are shared with the carvers' height providers and, later, with feature placement. They sit beside the first stage that needed them rather than in a module of their own.

Classes ​

Interfaces ​

Aquifer ​

Defined in: chunk/Aquifer.ts:88

Decides what fills a position once the terrain density says it is not stone.

Methods ​

computeSubstance() ​

computeSubstance(x, y, z, density): string | undefined

Defined in: chunk/Aquifer.ts:94

Returns the block that fills a position, or undefined to leave the default block there.

Parameters ​
x ​

number

y ​

number

z ​

number

density ​

number

The final density at the position; positive means solid.

Returns ​

string | undefined

shouldScheduleFluidUpdate() ​

shouldScheduleFluidUpdate(): boolean

Defined in: chunk/Aquifer.ts:96

Whether the last Aquifer.computeSubstance call wants a fluid tick scheduled.

Returns ​

boolean


AquiferConfig ​

Defined in: settings/NoiseGeneratorSettings.ts:38

The six density functions that drive aquifer placement.

Properties ​

barrierNoise ​

readonly barrierNoise: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:40

Noise that thickens the stone barrier between two aquifers.

exclusion ​

readonly exclusion: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:48

Positive values switch aquifers off, which keeps them out of the deep dark.

fluidLevelFloodednessNoise ​

readonly fluidLevelFloodednessNoise: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:42

Noise that decides how full an aquifer cell is.

fluidLevelSpreadNoise ​

readonly fluidLevelSpreadNoise: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:44

Noise that offsets a partially flooded aquifer's surface.

lavaNoise ​

readonly lavaNoise: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:46

Noise that turns an aquifer into lava.

surfaceLevel ​

readonly surfaceLevel: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:50

The preliminary surface height aquifer cells measure their depth against.


AquiferVolume ​

Defined in: chunk/Aquifer.ts:72

The block extent one aquifer covers, which is normally one chunk column.

Properties ​

maxBlockX ​

readonly maxBlockX: number

Defined in: chunk/Aquifer.ts:80

The highest block x in the extent, inclusive.

maxBlockY ​

readonly maxBlockY: number

Defined in: chunk/Aquifer.ts:82

The highest block y in the extent, inclusive.

maxBlockZ ​

readonly maxBlockZ: number

Defined in: chunk/Aquifer.ts:84

The highest block z in the extent, inclusive.

minBlockX ​

readonly minBlockX: number

Defined in: chunk/Aquifer.ts:74

The lowest block x in the extent.

minBlockY ​

readonly minBlockY: number

Defined in: chunk/Aquifer.ts:76

The lowest block y in the extent.

minBlockZ ​

readonly minBlockZ: number

Defined in: chunk/Aquifer.ts:78

The lowest block z in the extent.


BiomeClimate ​

Defined in: biome/BiomeClimate.ts:10

The two climate fields of a worldgen/biome document that the surface pass reads.

Properties ​

baseTemperature ​

readonly baseTemperature: number

Defined in: biome/BiomeClimate.ts:12

The biome's temperature field.

temperatureModifier ​

readonly temperatureModifier: TemperatureModifier

Defined in: biome/BiomeClimate.ts:14

The biome's temperature_modifier field.


BiomeSource ​

Defined in: biome/BiomeSource.ts:67

A dimension's biome layout.

A source is immutable and seed-independent; binding it to a ClimateSampler through BiomeSource.resolver is what ties it to a world.

Methods ​

possibleBiomes() ​

possibleBiomes(): readonly string[]

Defined in: biome/BiomeSource.ts:69

Every biome this source can produce, which the surface pass uses to prune rules.

Returns ​

readonly string[]

resolver() ​

resolver(sampler): BiomeResolver

Defined in: biome/BiomeSource.ts:71

Binds the source to one world's climate functions.

Parameters ​
sampler ​

ClimateSampler

Returns ​

BiomeResolver


BlendedNoiseFbmSet ​

Defined in: noise/BlendedNoise.ts:56

The three octave stacks old_blended_noise samples: two limits and one selector.

Properties ​

mainNoise ​

readonly mainNoise: NoiseStack

Defined in: noise/BlendedNoise.ts:62

The selector noise that chooses between the two limits.

maxLimitNoise ​

readonly maxLimitNoise: NoiseStack

Defined in: noise/BlendedNoise.ts:60

The upper limit noise.

minLimitNoise ​

readonly minLimitNoise: NoiseStack

Defined in: noise/BlendedNoise.ts:58

The lower limit noise.


BlendedNoiseParameters ​

Defined in: noise/BlendedNoise.ts:17

The five scale parameters of an old_blended_noise density function.

Properties ​

smearScaleMultiplier ​

readonly smearScaleMultiplier: number

Defined in: noise/BlendedNoise.ts:27

Multiplies the vertical smear of the two limit noises.

xzFactor ​

readonly xzFactor: number

Defined in: noise/BlendedNoise.ts:23

Divides the horizontal scale of the selector noise.

xzScale ​

readonly xzScale: number

Defined in: noise/BlendedNoise.ts:19

Horizontal coordinate scale, multiplied by 684.412.

yFactor ​

readonly yFactor: number

Defined in: noise/BlendedNoise.ts:25

Divides the vertical scale of the selector noise.

yScale ​

readonly yScale: number

Defined in: noise/BlendedNoise.ts:21

Vertical coordinate scale, multiplied by 684.412.


BlockArraySurfaceChunkOptions ​

Defined in: surface/SurfaceChunk.ts:34

How a BlockArraySurfaceChunk reads its starting terrain.

Properties ​

chunkX ​

readonly chunkX: number

Defined in: surface/SurfaceChunk.ts:36

The chunk x coordinate, in chunks.

chunkZ ​

readonly chunkZ: number

Defined in: surface/SurfaceChunk.ts:38

The chunk z coordinate, in chunks.

column ​

readonly column: (localX, localZ) => readonly string[]

Defined in: surface/SurfaceChunk.ts:42

One column of block state identifiers, ordered from minY upward.

Parameters ​
localX ​

number

localZ ​

number

Returns ​

readonly string[]

minY ​

readonly minY: number

Defined in: surface/SurfaceChunk.ts:40

The lowest y the chunk holds.


BuildSurfaceOptions ​

Defined in: surface/SurfaceSystem.ts:104

What the surface pass needs besides the chunk it is building.

Properties ​

biomeAt ​

readonly biomeAt: (x, y, z) => string

Defined in: surface/SurfaceSystem.ts:110

The biome at a block position, which has to vary per column.

Parameters ​
x ​

number

y ​

number

z ​

number

Returns ​

string

biomeClimate ​

readonly biomeClimate: BiomeClimateLookup

Defined in: surface/SurfaceSystem.ts:112

The climate of a biome, which the temperature condition and icebergs read.

chunk ​

readonly chunk: SurfaceChunk

Defined in: surface/SurfaceSystem.ts:106

The chunk, already filled with terrain and fluids.

possibleBiomes? ​

readonly optional possibleBiomes?: ReadonlySet<string>

Defined in: surface/SurfaceSystem.ts:116

Every biome the chunk can hold, which lets a biome condition fold to a constant.

rule ​

readonly rule: MaterialRuleNode

Defined in: surface/SurfaceSystem.ts:108

The rule tree, which NoiseGeneratorSettings.materialRule names.

sampleContext? ​

readonly optional sampleContext?: SampleContext

Defined in: surface/SurfaceSystem.ts:114

The memo slots the compiled density functions share; one per chunk.


CanyonCarverConfig ​

Defined in: carver/Carver.ts:72

A minecraft:canyon carver, which digs one long ravine.

Properties ​

probability ​

readonly probability: number

Defined in: carver/Carver.ts:76

The chance a chunk starts one of these at all.

shape ​

readonly shape: CanyonShape

Defined in: carver/Carver.ts:82

The shape fields.

type ​

readonly type: "canyon"

Defined in: carver/Carver.ts:74

The carver type.

verticalRotation ​

readonly verticalRotation: FloatProvider

Defined in: carver/Carver.ts:80

The initial pitch of the canyon.

y ​

readonly y: HeightProvider

Defined in: carver/Carver.ts:78

Where the canyon starts vertically.


CanyonShape ​

Defined in: carver/Carver.ts:54

The shape fields of a minecraft:canyon carver.

Properties ​

distanceFactor ​

readonly distanceFactor: FloatProvider

Defined in: carver/Carver.ts:56

A factor on how far the canyon walks.

horizontalRadiusFactor ​

readonly horizontalRadiusFactor: FloatProvider

Defined in: carver/Carver.ts:62

A per-step factor on the width.

thickness ​

readonly thickness: FloatProvider

Defined in: carver/Carver.ts:58

How wide the canyon is at its middle.

verticalRadiusCenterFactor ​

readonly verticalRadiusCenterFactor: number

Defined in: carver/Carver.ts:66

The extra height factor applied at the canyon's middle.

verticalRadiusDefaultFactor ​

readonly verticalRadiusDefaultFactor: number

Defined in: carver/Carver.ts:64

The height factor applied along the whole canyon.

widthSmoothness ​

readonly widthSmoothness: number

Defined in: carver/Carver.ts:60

One step in this many changes the wall width, so a higher value is smoother.

yScale ​

readonly yScale: FloatProvider

Defined in: carver/Carver.ts:68

How tall the canyon is relative to its width.


CarveChunkOptions ​

Defined in: carver/Carver.ts:483

What carveChunk needs to sweep the chunks around one target chunk.

Properties ​

carversAt ​

readonly carversAt: (sourceChunkX, sourceChunkZ) => readonly CarverConfig[]

Defined in: carver/Carver.ts:491

The carvers a source chunk's biome lists, in the order the biome lists them.

Parameters ​
sourceChunkX ​

number

sourceChunkZ ​

number

Returns ​

readonly CarverConfig[]

chunkX ​

readonly chunkX: number

Defined in: carver/Carver.ts:487

The chunk x being carved, in chunks.

chunkZ ​

readonly chunkZ: number

Defined in: carver/Carver.ts:489

The chunk z being carved, in chunks.

context ​

readonly context: WorldGenerationContext

Defined in: carver/Carver.ts:493

The dimension extent, which the height providers resolve against.

output ​

readonly output: CarverOutput

Defined in: carver/Carver.ts:495

Where the openings are recorded.

seed ​

readonly seed: bigint

Defined in: carver/Carver.ts:485

The world seed.


CarverOutput ​

Defined in: carver/CarvingMask.ts:7

Where a carver writes its openings.

Properties ​

maxY ​

readonly maxY: number

Defined in: carver/CarvingMask.ts:11

The highest y the carver may open.

minY ​

readonly minY: number

Defined in: carver/CarvingMask.ts:9

The lowest y the carver may open.

Methods ​

carve() ​

carve(localX, y, localZ): void

Defined in: carver/CarvingMask.ts:13

Opens one block, addressed by its position inside the chunk.

Parameters ​
localX ​

number

y ​

number

localZ ​

number

Returns ​

void


CaveCarverConfig ​

Defined in: carver/Carver.ts:28

A minecraft:cave carver, which digs rooms and branching tunnels.

Properties ​

count ​

readonly count: IntProvider

Defined in: carver/Carver.ts:36

How many caves one starting chunk digs.

floorLevel ​

readonly floorLevel: FloatProvider

Defined in: carver/Carver.ts:50

How much of the bottom of a tunnel stays solid, as a fraction of its height.

horizontalRadiusMultiplier ​

readonly horizontalRadiusMultiplier: FloatProvider

Defined in: carver/Carver.ts:44

A per-cave factor on every tunnel's width.

probability ​

readonly probability: number

Defined in: carver/Carver.ts:32

The chance a chunk starts one of these at all.

roomVerticalRadiusMultiplier ​

readonly roomVerticalRadiusMultiplier: FloatProvider

Defined in: carver/Carver.ts:42

How tall a room is relative to its width.

startVerticalRadiusMultiplier ​

readonly startVerticalRadiusMultiplier: FloatProvider

Defined in: carver/Carver.ts:48

A factor on the first tunnel's height, which the nether raises to five.

thickness ​

readonly thickness: FloatProvider

Defined in: carver/Carver.ts:38

How wide a tunnel is at its middle.

type ​

readonly type: "cave"

Defined in: carver/Carver.ts:30

The carver type.

verticalRadiusMultiplier ​

readonly verticalRadiusMultiplier: FloatProvider

Defined in: carver/Carver.ts:46

A per-cave factor on every tunnel's height.

weirdThicknessBias ​

readonly weirdThicknessBias: boolean

Defined in: carver/Carver.ts:40

Whether one tunnel in ten gets a randomly widened thickness.

y ​

readonly y: HeightProvider

Defined in: carver/Carver.ts:34

Where a cave starts vertically.


ChunkSamplerOptions ​

Defined in: chunk/ChunkSampler.ts:28

Options for building a ChunkSampler.

Properties ​

chunkX ​

readonly chunkX: number

Defined in: chunk/ChunkSampler.ts:30

The chunk x coordinate, in chunks.

chunkZ ​

readonly chunkZ: number

Defined in: chunk/ChunkSampler.ts:32

The chunk z coordinate, in chunks.

context? ​

readonly optional context?: SampleContext

Defined in: chunk/ChunkSampler.ts:36

An exclusive caller-owned context; reset and reuse it only after this sampler has finished.

fluidPicker? ​

readonly optional fluidPicker?: FluidPicker

Defined in: chunk/ChunkSampler.ts:34

Overrides the dimension-wide fluid picker, which parity harnesses sometimes need.

skipProvenCells? ​

readonly optional skipProvenCells?: boolean

Defined in: chunk/ChunkSampler.ts:38

Whether to skip proven cells whose final density cannot be positive. Defaults to true.

useVolumeDensity? ​

readonly optional useVolumeDensity?: boolean

Defined in: chunk/ChunkSampler.ts:42

Evaluates each visited interpolation cell into typed arrays instead of sampling each block.

verifySkippedCells? ​

readonly optional verifySkippedCells?: boolean

Defined in: chunk/ChunkSampler.ts:40

Re-samples skipped blocks through the scalar path and checks their states and fluid flags.


ClimateEntry ​

Defined in: biome/Climate.ts:540

One biome and the climate box that claims it.

Type Parameters ​

T ​

T

Properties ​

point ​

readonly point: ClimateParameterPoint

Defined in: biome/Climate.ts:542

The box.

value ​

readonly value: T

Defined in: biome/Climate.ts:544

What the box resolves to, which for a biome source is a biome identifier.


ClimateParameter ​

Defined in: biome/Climate.ts:33

One axis of a biome's climate box, in quantized units.

Properties ​

max ​

readonly max: number

Defined in: biome/Climate.ts:37

The inclusive upper bound.

min ​

readonly min: number

Defined in: biome/Climate.ts:35

The inclusive lower bound.


ClimateParameterIndex ​

Defined in: biome/Climate.ts:216

The seven-dimensional climate entries and exact nearest-box lookup they index.

Type Parameters ​

T ​

T

Properties ​

entries ​

readonly entries: readonly ClimateEntry<T>[]

Defined in: biome/Climate.ts:218

The boxes in the order the source data lists them.

Methods ​

distinctValues() ​

distinctValues(): readonly T[]

Defined in: biome/Climate.ts:224

Returns unique entry values in first-occurrence order.

Returns ​

readonly T[]

find() ​

find(target): T

Defined in: biome/Climate.ts:220

Returns the value of the nearest box, breaking exact ties by first tree order.

Parameters ​
target ​

ClimateTargetPoint

Returns ​

T

findBruteForce() ​

findBruteForce(target): T

Defined in: biome/Climate.ts:222

Returns the value of the nearest box by scanning each source entry in order.

Parameters ​
target ​

ClimateTargetPoint

Returns ​

T


ClimateParameterPoint ​

Defined in: biome/Climate.ts:41

A climate box: one range per axis plus the tie-breaking offset.

Properties ​

continentalness ​

readonly continentalness: ClimateParameter

Defined in: biome/Climate.ts:47

The land-versus-ocean axis.

depth ​

readonly depth: ClimateParameter

Defined in: biome/Climate.ts:51

How far below the surface the cell is.

erosion ​

readonly erosion: ClimateParameter

Defined in: biome/Climate.ts:49

The flatness axis.

humidity ​

readonly humidity: ClimateParameter

Defined in: biome/Climate.ts:45

How wet the biome is, which Java's noise router still calls vegetation.

offset ​

readonly offset: number

Defined in: biome/Climate.ts:55

A constant penalty that breaks ties between overlapping boxes.

temperature ​

readonly temperature: ClimateParameter

Defined in: biome/Climate.ts:43

How warm the biome is.

weirdness ​

readonly weirdness: ClimateParameter

Defined in: biome/Climate.ts:53

The peaks-and-valleys axis.


ClimateSampler ​

Defined in: biome/ClimateSampler.ts:14

The six climate slots of the noise router, sampled at a biome cell.

Biome cells are 4 by 4 by 4 blocks, so a sampler takes quart coordinates and multiplies by four before it reaches the density functions. The end biome source is the one caller that also needs a raw block-coordinate sample, which ClimateSampler.erosion gives it.

Methods ​

erosion() ​

erosion(x, y, z): number

Defined in: biome/ClimateSampler.ts:18

Samples the erosion function at one block position.

Parameters ​
x ​

number

y ​

number

z ​

number

Returns ​

number

sample() ​

sample(quartX, quartY, quartZ): ClimateTargetPoint

Defined in: biome/ClimateSampler.ts:16

Samples all six climate functions at one biome cell.

Parameters ​
quartX ​

number

quartY ​

number

quartZ ​

number

Returns ​

ClimateTargetPoint


ClimateTargetPoint ​

Defined in: biome/Climate.ts:59

One sampled position in climate space, in quantized units.

Properties ​

continentalness ​

readonly continentalness: number

Defined in: biome/Climate.ts:65

The sampled continentalness.

depth ​

readonly depth: number

Defined in: biome/Climate.ts:69

The sampled depth.

erosion ​

readonly erosion: number

Defined in: biome/Climate.ts:67

The sampled erosion.

humidity ​

readonly humidity: number

Defined in: biome/Climate.ts:63

The sampled humidity.

temperature ​

readonly temperature: number

Defined in: biome/Climate.ts:61

The sampled temperature.

weirdness ​

readonly weirdness: number

Defined in: biome/Climate.ts:71

The sampled weirdness.


ColumnBlock ​

Defined in: chunk/ChunkSampler.ts:20

One block of a generated column.

Properties ​

scheduleFluidUpdate ​

readonly scheduleFluidUpdate: boolean

Defined in: chunk/ChunkSampler.ts:24

Whether the aquifer wants a fluid tick scheduled at this position.

state ​

readonly state: string

Defined in: chunk/ChunkSampler.ts:22

The Java block state identifier, minecraft:air where nothing is placed.


CompileEnvironment ​

Defined in: density/compile.ts:304

What the compiler needs from the world seed to turn a tree into closures.

Methods ​

endIslandRandom() ​

endIslandRandom(): RandomSource

Defined in: density/compile.ts:310

Returns the legacy random source the outer end islands are seeded from.

Returns ​

RandomSource

noise() ​

noise(id): Noise

Defined in: density/compile.ts:306

Returns the seeded noise instance for a worldgen/noise identifier.

Parameters ​
id ​

string

Returns ​

Noise

random() ​

random(id): RandomSource

Defined in: density/compile.ts:308

Returns the random source keyed by a name, used by old_blended_noise.

Parameters ​
id ​

string

Returns ​

RandomSource


DebugGeneratorDefinition ​

Defined in: dimension/LevelStem.ts:46

The minecraft:debug generator, which has no fields.

Properties ​

type ​

readonly type: "minecraft:debug"

Defined in: dimension/LevelStem.ts:47


DensityFunctionCompilerOptions ​

Defined in: density/compile.ts:314

Options for comparing the scalar interpolation path with reusable cell buffers.

Properties ​

generatedFunctions? ​

readonly optional generatedFunctions?: boolean

Defined in: density/compile.ts:318

Emits a closed JavaScript evaluator for supported nodes; disabled unless explicitly measured.

maximumGeneratedFunctionLength? ​

readonly optional maximumGeneratedFunctionLength?: number

Defined in: density/compile.ts:320

Maximum generated source length before one tree falls back to closures.

precomputeInterpolationCells? ​

readonly optional precomputeInterpolationCells?: boolean

Defined in: density/compile.ts:316

Whether interpolated nodes fill a reusable typed array for cells up to 4096 blocks.


DensityVolume ​

Defined in: density/compile.ts:22

An integer block volume sampled with x varying fastest, then z, then y.

Properties ​

minX ​

readonly minX: number

Defined in: density/compile.ts:24

The lowest block x in the volume.

minY ​

readonly minY: number

Defined in: density/compile.ts:26

The lowest block y in the volume.

minZ ​

readonly minZ: number

Defined in: density/compile.ts:28

The lowest block z in the volume.

sizeX ​

readonly sizeX: number

Defined in: density/compile.ts:30

The number of x positions.

sizeY ​

readonly sizeY: number

Defined in: density/compile.ts:32

The number of y positions.

sizeZ ​

readonly sizeZ: number

Defined in: density/compile.ts:34

The number of z positions.


DensityVolumeEvaluator ​

Defined in: density/compile.ts:38

A compiled volume evaluator with a workspace it reuses between calls. Keep one per active task.

Properties ​

instructionCount ​

readonly instructionCount: number

Defined in: density/compile.ts:40

Number of distinct instructions in the compiled tree.

retainedWorkspaceBytes ​

readonly retainedWorkspaceBytes: number

Defined in: density/compile.ts:44

Bytes retained by the evaluator's intermediate typed arrays.

scalarFallbackCount ​

readonly scalarFallbackCount: number

Defined in: density/compile.ts:42

Number of nodes delegated to the scalar density compiler.

workspaceGrowthCount ​

readonly workspaceGrowthCount: number

Defined in: density/compile.ts:46

Number of times the evaluator had to resize its workspace.

Methods ​

sample() ​

sample(context, volume, output): void

Defined in: density/compile.ts:52

Samples a rectangular volume into caller-owned storage.

Parameters ​
context ​

SampleContext

volume ​

DensityVolume

output ​

Float64Array

Returns ​

void

Throws ​

When the bounds aren't safe integer block coordinates or the output is too short.


DimensionTypeDefinition ​

Defined in: dimension/DimensionType.ts:18

One data/<namespace>/dimension_type/<name>.json document in its 26.3 shape.

The booleans older versions kept at the top level (ultrawarm, bed_works, piglin_safe, has_raids, natural, respawn_anchor_works) moved into attributes in 1.21.11, so this definition carries the physics and the clock and leaves the gameplay rules as data.

Properties ​

ambientLight ​

readonly ambientLight: number

Defined in: dimension/DimensionType.ts:36

Light added to every block, 0 to 1.

attributes ​

readonly attributes: ReadonlyMap<string, unknown>

Defined in: dimension/DimensionType.ts:52

Environment attributes keyed by attribute id. Values stay as parsed JSON.

cardinalLight ​

readonly cardinalLight: DimensionCardinalLight

Defined in: dimension/DimensionType.ts:46

The directional block shading. Defaults to default.

coordinateScale ​

readonly coordinateScale: number

Defined in: dimension/DimensionType.ts:26

The multiplier applied to x and z when leaving the dimension; 8 for the nether.

defaultClock? ​

readonly optional defaultClock?: string

Defined in: dimension/DimensionType.ts:48

The clock /time and sleeping act on; absent for the nether.

hasCeiling ​

readonly hasCeiling: boolean

Defined in: dimension/DimensionType.ts:30

Whether a bedrock ceiling closes the dimension, which changes respawn and map behavior.

hasEnderDragonFight ​

readonly hasEnderDragonFight: boolean

Defined in: dimension/DimensionType.ts:34

Whether the ender dragon fight runs here.

hasFixedTime ​

readonly hasFixedTime: boolean

Defined in: dimension/DimensionType.ts:32

Whether the clock never advances; replaced fixed_time in 25w45a.

hasSkylight ​

readonly hasSkylight: boolean

Defined in: dimension/DimensionType.ts:28

Whether sky light exists. False also disables weather.

height ​

readonly height: number

Defined in: dimension/DimensionType.ts:22

How many blocks the dimension spans above minY, a multiple of 16 between 16 and 4064.

infiniburn ​

readonly infiniburn: string

Defined in: dimension/DimensionType.ts:42

The block tag, or since 26.2 the block id, that burns forever. Kept as written.

logicalHeight ​

readonly logicalHeight: number

Defined in: dimension/DimensionType.ts:24

The ceiling for chorus fruit and portal placement; at most height.

minY ​

readonly minY: number

Defined in: dimension/DimensionType.ts:20

The lowest block y, a multiple of 16 between -2032 and 2031.

monsterSpawnBlockLightLimit ​

readonly monsterSpawnBlockLightLimit: number

Defined in: dimension/DimensionType.ts:40

The block light a monster spawn position may have at most.

monsterSpawnLightLevel ​

readonly monsterSpawnLightLevel: IntProvider

Defined in: dimension/DimensionType.ts:38

The light test a monster spawn has to pass.

skybox ​

readonly skybox: DimensionSkybox

Defined in: dimension/DimensionType.ts:44

The sky the client renders. Defaults to overworld.

timelines ​

readonly timelines: readonly string[]

Defined in: dimension/DimensionType.ts:50

The timeline ids or tags that run in this dimension. Kept as written.


FlatGeneratorDefinition ​

Defined in: dimension/LevelStem.ts:25

A minecraft:flat generator and its layers.

Properties ​

settings ​

readonly settings: FlatGeneratorSettings

Defined in: dimension/LevelStem.ts:28

The layers, biome and feature flags.

type ​

readonly type: "minecraft:flat"

Defined in: dimension/LevelStem.ts:26


FlatGeneratorSettings ​

Defined in: dimension/FlatGeneratorSettings.ts:16

The settings object of a minecraft:flat generator, which is also the settings of a worldgen/flat_level_generator_preset document.

Properties ​

biome ​

readonly biome: string

Defined in: dimension/FlatGeneratorSettings.ts:20

The single biome the whole world has. Defaults to minecraft:plains.

features ​

readonly features: boolean

Defined in: dimension/FlatGeneratorSettings.ts:24

Whether the biome's placed features generate. Defaults to false.

lakes ​

readonly lakes: boolean

Defined in: dimension/FlatGeneratorSettings.ts:22

Whether lava lakes generate. Defaults to false.

layers ​

readonly layers: readonly FlatLayer[]

Defined in: dimension/FlatGeneratorSettings.ts:18

The layers, bottom up. May be empty.

structureOverrides? ​

readonly optional structureOverrides?: string | readonly string[]

Defined in: dimension/FlatGeneratorSettings.ts:29

The structure sets that place structures, as one id or tag or a list of ids. Absent means every registered structure set, as in Java.


FlatLayer ​

Defined in: dimension/FlatGeneratorSettings.ts:5

One layer of a superflat world, read bottom up from the dimension's min_y.

Properties ​

block ​

readonly block: string

Defined in: dimension/FlatGeneratorSettings.ts:7

The Java block identifier the layer is made of.

height ​

readonly height: number

Defined in: dimension/FlatGeneratorSettings.ts:9

How many blocks thick the layer is, 0 to 4064.


FlatPresetGeneratorDefinition ​

Defined in: dimension/LevelStem.ts:39

A minecraft:flat generator that names a worldgen/flat_level_generator_preset instead of carrying its settings, as Java's world_gen_settings allows.

The preset registry belongs to whoever loaded the pack stack, so the id is kept for the generator factory to resolve; the preset document's settings object is what parseFlatGeneratorSettings then reads.

Properties ​

settings ​

readonly settings: string

Defined in: dimension/LevelStem.ts:42

The worldgen/flat_level_generator_preset id, namespaced.

type ​

readonly type: "minecraft:flat"

Defined in: dimension/LevelStem.ts:40


GaussianCacheState ​

Defined in: random/RandomSource.ts:35

The cached second Gaussian draw, which is part of a random source's continuation state.

Properties ​

cachedGaussian ​

readonly cachedGaussian: number

Defined in: random/RandomSource.ts:38

hasCachedGaussian ​

readonly hasCachedGaussian: boolean

Defined in: random/RandomSource.ts:37

version ​

readonly version: 1

Defined in: random/RandomSource.ts:36


InterpolationCellSize ​

Defined in: density/compile.ts:278

The block extent an interpolated node holds its eight corners still across.

A caller that visits a chunk in blocks of this size keeps one cell current for the whole block, which is what turns eight corner-cache lookups per sample into eight per cell.

Properties ​

xz ​

readonly xz: number

Defined in: density/compile.ts:280

The cell side across x and across z, in blocks.

y ​

readonly y: number

Defined in: density/compile.ts:282

The cell height, in blocks.


LegacyRandomSourceState ​

Defined in: random/RandomSource.ts:42

JSON-safe state for LegacyRandomSource.

Properties ​

algorithm ​

readonly algorithm: "legacy"

Defined in: random/RandomSource.ts:44

gaussian ​

readonly gaussian: GaussianCacheState

Defined in: random/RandomSource.ts:47

seed ​

readonly seed: number

Defined in: random/RandomSource.ts:46

The 48-bit internal Java LCG state, represented as an exact JSON number.

version ​

readonly version: 1

Defined in: random/RandomSource.ts:43


LevelStem ​

Defined in: dimension/LevelStem.ts:66

One dimension of a world: a dimension_type id bound to a generator.

Properties ​

generator ​

readonly generator: GeneratorDefinition

Defined in: dimension/LevelStem.ts:70

The generator that fills the dimension's chunks.

type ​

readonly type: string

Defined in: dimension/LevelStem.ts:68

The dimension_type id.


MaterialRuleContextOptions ​

Defined in: surface/MaterialRuleContext.ts:26

What a MaterialRuleContext needs besides the world seed.

Properties ​

biomeAt ​

readonly biomeAt: (x, y, z) => string

Defined in: surface/MaterialRuleContext.ts:32

The biome at a block position, which a biome condition reads per column.

Parameters ​
x ​

number

y ​

number

z ​

number

Returns ​

string

biomeClimate ​

readonly biomeClimate: BiomeClimateLookup

Defined in: surface/MaterialRuleContext.ts:34

The climate of a biome, which a temperature condition reads.

generationContext ​

readonly generationContext: WorldGenerationContext

Defined in: surface/MaterialRuleContext.ts:36

The dimension extent a vertical anchor resolves against.

possibleBiomes? ​

readonly optional possibleBiomes?: ReadonlySet<string>

Defined in: surface/MaterialRuleContext.ts:40

Every biome the chunk can hold, which lets a biome condition fold to a constant.

randomState ​

readonly randomState: RandomState

Defined in: surface/MaterialRuleContext.ts:30

The seeded noises, randoms and compiled density functions.

sampleContext? ​

readonly optional sampleContext?: SampleContext

Defined in: surface/MaterialRuleContext.ts:38

The memo slots the compiled density functions share; one per chunk.

system ​

readonly system: SurfaceSystem

Defined in: surface/MaterialRuleContext.ts:28

The surface system that owns the noises and the clay bands.


MaterialRuleSource ​

Defined in: surface/MaterialRule.ts:108

The registries a material rule document can reference.

Properties ​

biomeTag? ​

readonly optional biomeTag?: (tag) => readonly string[]

Defined in: surface/MaterialRule.ts:114

Expands a #biome tag that a biome condition names.

Parameters ​
tag ​

string

Returns ​

readonly string[]

materialConditions ​

readonly materialConditions: ReadonlyMap<string, unknown>

Defined in: surface/MaterialRule.ts:112

worldgen/material_condition, keyed by identifier.

materialRules ​

readonly materialRules: ReadonlyMap<string, unknown>

Defined in: surface/MaterialRule.ts:110

worldgen/material_rule, keyed by identifier.


MultiNoiseBiomeEntry ​

Defined in: dimension/parseBiomeSource.ts:14

One inline entry of a multi_noise biome source's biomes list.

Properties ​

biome ​

readonly biome: string

Defined in: dimension/parseBiomeSource.ts:16

The biome the climate box belongs to.

parameters ​

readonly parameters: ClimateParameterPoint

Defined in: dimension/parseBiomeSource.ts:18

The climate box.


MultipointSpline ​

Defined in: density/CubicSpline.ts:8

The pieces a compiled multipoint spline is built from.

Properties ​

coordinate ​

readonly coordinate: CompiledSpline

Defined in: density/CubicSpline.ts:10

Reads the value that selects a point on the curve.

derivatives ​

readonly derivatives: readonly number[]

Defined in: density/CubicSpline.ts:16

The slope used to extend the curve past each end knot.

locations ​

readonly locations: readonly number[]

Defined in: density/CubicSpline.ts:12

Knot positions along the coordinate, ascending.

values ​

readonly values: readonly CompiledSpline[]

Defined in: density/CubicSpline.ts:14

The nested spline evaluated at each knot.


Noise ​

Defined in: noise/GradientNoise.ts:45

A noise function sampled in two or three dimensions, returning a single-precision value.

Methods ​

get2() ​

get2(x, z): number

Defined in: noise/GradientNoise.ts:49

Samples at a 2D position, which Java treats as y = 0.

Parameters ​
x ​

number

z ​

number

Returns ​

number

get3() ​

get3(x, y, z): number

Defined in: noise/GradientNoise.ts:47

Samples at a 3D position.

Parameters ​
x ​

number

y ​

number

z ​

number

Returns ​

number


NoiseGeneratorDefinition ​

Defined in: dimension/LevelStem.ts:16

A minecraft:noise generator: a worldgen/noise_settings id or inline document and a biome source.

An inline document stays as parsed JSON because reading it needs a density function resolver; parseNoiseGeneratorSettings takes it from here. The vanilla presets only ever reference settings by id.

Properties ​

biomeSource ​

readonly biomeSource: BiomeSourceDefinition

Defined in: dimension/LevelStem.ts:21

The biome layout.

settings ​

readonly settings: string | Readonly<Record<string, unknown>>

Defined in: dimension/LevelStem.ts:19

The worldgen/noise_settings id, or the inline document.

type ​

readonly type: "minecraft:noise"

Defined in: dimension/LevelStem.ts:17


NoiseGeneratorSettings ​

Defined in: settings/NoiseGeneratorSettings.ts:62

One worldgen/noise_settings document.

Properties ​

aquifers ​

readonly aquifers: AquiferConfig | undefined

Defined in: settings/NoiseGeneratorSettings.ts:80

The aquifer functions, absent in dimensions that generate no aquifers.

defaultBlock ​

readonly defaultBlock: string

Defined in: settings/NoiseGeneratorSettings.ts:66

The Java block state identifier used where the density is solid.

defaultFluid ​

readonly defaultFluid: string

Defined in: settings/NoiseGeneratorSettings.ts:68

The Java block state identifier used for the dimension's sea.

disableMobGeneration ​

readonly disableMobGeneration: boolean

Defined in: settings/NoiseGeneratorSettings.ts:78

Whether the generator suppresses the first mob spawn pass.

materialRule ​

readonly materialRule: string

Defined in: settings/NoiseGeneratorSettings.ts:74

The material_rule reference the surface pass resolves.

noiseRouter ​

readonly noiseRouter: NoiseRouter

Defined in: settings/NoiseGeneratorSettings.ts:70

The eight router slots.

noiseSettings ​

readonly noiseSettings: NoiseSettings

Defined in: settings/NoiseGeneratorSettings.ts:64

The vertical extent.

seaLevel ​

readonly seaLevel: number

Defined in: settings/NoiseGeneratorSettings.ts:76

The y level the global fluid picker fills to.

spawnTargets ​

readonly spawnTargets: readonly SpawnTargetPoint[]

Defined in: settings/NoiseGeneratorSettings.ts:72

Climate targets Java uses to choose a noise world's origin chunk.

useLegacyRandomSource ​

readonly useLegacyRandomSource: boolean

Defined in: settings/NoiseGeneratorSettings.ts:82

Whether the world seeds its randoms with the 48-bit legacy generator.


NoiseLayer ​

Defined in: noise/NoiseStack.ts:5

One octave inside a NoiseStack: a noise, its coordinate scale and its weight.

Properties ​

amplitude ​

readonly amplitude: number

Defined in: noise/NoiseStack.ts:11

The single-precision weight applied to the octave's output.

frequency ​

readonly frequency: number

Defined in: noise/NoiseStack.ts:9

The factor applied to the sample coordinates.

noise ​

readonly noise: Noise

Defined in: noise/NoiseStack.ts:7

The octave's noise function.


NoiseParameters ​

Defined in: noise/NormalNoise.ts:23

The contents of one worldgen/noise JSON file.

26.3 renamed these fields: 1.21's firstOctave and amplitudes became base_octave, octave_count, base_amplitude and amplitude_modifiers, and the octave seeds changed from a chained random to fromHashOf("octave_<index>"). A loader written for the old shape produces different terrain rather than an error.

Properties ​

amplitudeModifiers ​

readonly amplitudeModifiers: readonly number[]

Defined in: noise/NormalNoise.ts:33

Per-octave amplitude multipliers, empty when every octave uses 1.

baseAmplitude ​

readonly baseAmplitude: number

Defined in: noise/NormalNoise.ts:25

The amplitude of the first octave before normalization.

baseOctave ​

readonly baseOctave: number

Defined in: noise/NormalNoise.ts:27

The exponent of the first octave's frequency, so frequency is 2 ** baseOctave.

normalize ​

readonly normalize: NoiseNormalization

Defined in: noise/NormalNoise.ts:31

Whether the octave amplitudes are rescaled to the target deviation.

octaveCount ​

readonly octaveCount: number

Defined in: noise/NormalNoise.ts:29

How many octaves the noise has.


NoiseRouter ​

Defined in: settings/NoiseGeneratorSettings.ts:18

The eight named slots of a 26.3 noise router.

1.21 had fifteen. The aquifer entries (barrier, fluid_level_floodedness, fluid_level_spread, lava) moved into AquiferConfig, the ore vein entries (vein_toggle, vein_ridged, vein_gap) moved into the minecraft:ore_vein material rule, initial_density_without_jaggedness became chunk_surface_level, and the climate slots stayed where they were.

Properties ​

chunkSurfaceLevel ​

readonly chunkSurfaceLevel: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:32

The preliminary surface height used before the surface pass runs.

continents ​

readonly continents: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:24

Continentalness, the land-versus-ocean axis.

depth ​

readonly depth: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:28

Depth, how far below the surface a position is.

erosion ​

readonly erosion: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:26

Erosion, the flatness axis.

finalDensity ​

readonly finalDensity: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:34

The density that decides whether a block is solid.

ridges ​

readonly ridges: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:30

Weirdness folded into ridges, the peaks-and-valleys axis.

temperature ​

readonly temperature: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:20

Climate temperature, sampled per biome cell.

vegetation ​

readonly vegetation: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:22

Climate humidity, which Java still names vegetation.


NoiseSettings ​

Defined in: settings/NoiseGeneratorSettings.ts:54

The vertical extent a dimension generates over.

Properties ​

height ​

readonly height: number

Defined in: settings/NoiseGeneratorSettings.ts:58

The number of blocks above minY, a multiple of 16.

minY ​

readonly minY: number

Defined in: settings/NoiseGeneratorSettings.ts:56

The lowest block y, a multiple of 16.


NoiseSpawnPosition ​

Defined in: spawn/NoiseSpawnFinder.ts:6

The climate-selected origin block and number of candidate positions Java evaluated.

Properties ​

candidates ​

readonly candidates: number

Defined in: spawn/NoiseSpawnFinder.ts:10

x ​

readonly x: number

Defined in: spawn/NoiseSpawnFinder.ts:7

y ​

readonly y: 0

Defined in: spawn/NoiseSpawnFinder.ts:8

z ​

readonly z: number

Defined in: spawn/NoiseSpawnFinder.ts:9


OreVeinRule ​

Defined in: chunk/oreVein.ts:12

One minecraft:ore_vein material rule, parsed.

Properties ​

density ​

readonly density: DensityFunctionNode

Defined in: chunk/oreVein.ts:22

How strongly a vein claims a position; values at or below zero place nothing.

fillerBlock ​

readonly fillerBlock: string

Defined in: chunk/oreVein.ts:18

The Java block state identifier that fills the vein around the ore.

fillerGap ​

readonly fillerGap: DensityFunctionNode

Defined in: chunk/oreVein.ts:26

Negative values punch holes of plain stone through a vein.

oreBlock ​

readonly oreBlock: string

Defined in: chunk/oreVein.ts:14

The Java block state identifier placed for an ordinary vein block.

rawOreBlock ​

readonly rawOreBlock: string

Defined in: chunk/oreVein.ts:16

The Java block state identifier placed for the rarer raw block.

rawOreChance ​

readonly rawOreChance: number

Defined in: chunk/oreVein.ts:20

The chance an ore block becomes the raw block instead.

richness ​

readonly richness: DensityFunctionNode

Defined in: chunk/oreVein.ts:24

How much of a claimed position is ore rather than filler.


PositionalRandomFactory ​

Defined in: random/RandomSource.ts:69

Derives a RandomSource from a position, a name or a seed.

Feature placement, aquifer cell centers and ore veins all key their randomness off a block position through one of these, which is what makes those stages reproducible per position rather than per call order.

Methods ​

at() ​

at(x, y, z): RandomSource

Defined in: random/RandomSource.ts:71

Returns the stream for one block position.

Parameters ​
x ​

number

y ​

number

z ​

number

Returns ​

RandomSource

fromHashOf() ​

fromHashOf(name): RandomSource

Defined in: random/RandomSource.ts:73

Returns the stream for a registry name, hashed with MD5 for Xoroshiro and String.hashCode for the legacy source.

Parameters ​
name ​

string

Returns ​

RandomSource

fromSeed() ​

fromSeed(seed): RandomSource

Defined in: random/RandomSource.ts:75

Returns the stream for a raw 64-bit seed.

Parameters ​
seed ​

bigint

Returns ​

RandomSource


RandomSource ​

Defined in: random/RandomSource.ts:7

A stream of pseudo-random numbers with Java Edition's RandomSource contract.

Both implementations in this package draw from the same interface, so a generator written against it works for a settings file with legacy_random_source either way.

Methods ​

consumeCount() ​

consumeCount(rounds): void

Defined in: random/RandomSource.ts:27

Advances the stream by rounds draws without returning them.

Parameters ​
rounds ​

number

Returns ​

void

fork() ​

fork(): RandomSource

Defined in: random/RandomSource.ts:29

Returns an independent stream seeded from this one, advancing this one.

Returns ​

RandomSource

forkPositional() ​

forkPositional(): PositionalRandomFactory

Defined in: random/RandomSource.ts:31

Returns a positional factory seeded from this stream, advancing it.

Returns ​

PositionalRandomFactory

nextBoolean() ​

nextBoolean(): boolean

Defined in: random/RandomSource.ts:19

Returns the next boolean, taken from one bit of the stream.

Returns ​

boolean

nextDouble() ​

nextDouble(): number

Defined in: random/RandomSource.ts:23

Returns the next value in [0, 1) with 53 bits of precision.

Returns ​

number

nextFloat() ​

nextFloat(): number

Defined in: random/RandomSource.ts:21

Returns the next value in [0, 1) with 24 bits of precision.

Returns ​

number

nextGaussian() ​

nextGaussian(): number

Defined in: random/RandomSource.ts:25

Returns the next normally distributed value with mean 0 and standard deviation 1.

Returns ​

number

nextInt() ​

nextInt(): number

Defined in: random/RandomSource.ts:9

Returns the next 32-bit signed integer, with every value equally likely.

Returns ​

number

nextIntBounded() ​

nextIntBounded(bound): number

Defined in: random/RandomSource.ts:15

Returns the next integer in [0, bound).

Parameters ​
bound ​

number

Returns ​

number

Throws ​

When bound is not positive, as Java does.

nextLong() ​

nextLong(): bigint

Defined in: random/RandomSource.ts:17

Returns the next 64-bit signed integer.

Returns ​

bigint


Seed128bit ​

Defined in: random/randomSupport.ts:18

A Xoroshiro128++ state: two 64-bit halves.

Properties ​

seedHi ​

readonly seedHi: bigint

Defined in: random/randomSupport.ts:22

The high half of the state.

seedLo ​

readonly seedLo: bigint

Defined in: random/randomSupport.ts:20

The low half of the state.


SpawnTargetFunction ​

Defined in: settings/NoiseGeneratorSettings.ts:86

One density function's climate interval within a Java spawn target.

Properties ​

density ​

readonly density: DensityFunctionNode

Defined in: settings/NoiseGeneratorSettings.ts:87

parameter ​

readonly parameter: ClimateParameter

Defined in: settings/NoiseGeneratorSettings.ts:88


SurfaceChunk ​

Defined in: surface/SurfaceChunk.ts:13

The chunk the surface pass reads and writes.

The terrain core returns block states rather than writing them, so this is the seam between it and whatever stores a chunk. BlockArraySurfaceChunk is the plain-array adapter; a caller with its own storage implements the four methods against that instead.

Properties ​

chunkX ​

readonly chunkX: number

Defined in: surface/SurfaceChunk.ts:15

The chunk x coordinate, in chunks.

chunkZ ​

readonly chunkZ: number

Defined in: surface/SurfaceChunk.ts:17

The chunk z coordinate, in chunks.

maxY ​

readonly maxY: number

Defined in: surface/SurfaceChunk.ts:21

The highest y the chunk holds.

minY ​

readonly minY: number

Defined in: surface/SurfaceChunk.ts:19

The lowest y the chunk holds.

Methods ​

getBlock() ​

getBlock(x, y, z): string

Defined in: surface/SurfaceChunk.ts:23

The Java block state identifier at a block position, minecraft:air where empty.

Parameters ​
x ​

number

y ​

number

z ​

number

Returns ​

string

setBlock() ​

setBlock(x, y, z, state): void

Defined in: surface/SurfaceChunk.ts:25

Writes a block state; a y outside the chunk is ignored, as it is in Java.

Parameters ​
x ​

number

y ​

number

z ​

number

state ​

string

Returns ​

void

surfaceHeight() ​

surfaceHeight(localX, localZ): number

Defined in: surface/SurfaceChunk.ts:30

The y of the highest block in a column that is not air, or minY - 1 when the column is empty. This is Java's WORLD_SURFACE_WG heightmap, frozen at the end of the terrain fill.

Parameters ​
localX ​

number

localZ ​

number

Returns ​

number


SurfacePass ​

Defined in: surface/SurfaceSystem.ts:88

What one chunk's finished surface pass can still answer.

Java's terrain status runs the carvers after the surface materials are in, and a carver that cuts through a grass block asks the material rule what the dirt it exposed should become. The rule is compiled once per chunk against one position context, so the answer comes from the pass that compiled it rather than from a second compile per carved block.

Java builds a fresh context per call instead. The two agree because every cached answer in the context is keyed by the update counters, which both updateXZ and updateY bump.

Methods ​

topMaterial() ​

topMaterial(blockX, blockY, blockZ, hasFluid): string | undefined

Defined in: surface/SurfaceSystem.ts:100

The material the rule puts at one position, both stone depth counters pinned to one.

This is Java's MaterialSystem.topMaterial. The pinned counters make the rule answer with the column's top material whatever shape the column has after a carver cut it, which is the point: the real counters would describe the hole, not the ground.

Parameters ​
blockX ​

number

blockY ​

number

blockZ ​

number

hasFluid ​

boolean

Whether the block above this one holds a fluid. It becomes the water height the water condition reads, so a flooded cave gets its underwater material.

Returns ​

string | undefined

The block to place, or undefined when no rule matched the position.


UnknownGeneratorDefinition ​

Defined in: dimension/LevelStem.ts:51

A generator kind this package does not know. Its settings stay as JSON for a factory to read.

Properties ​

settings ​

readonly settings: unknown

Defined in: dimension/LevelStem.ts:54

Whatever the document carried under settings, or undefined.

type ​

readonly type: string

Defined in: dimension/LevelStem.ts:52


WorldGenerationContext ​

Defined in: surface/VerticalAnchor.ts:19

The dimension extent a VerticalAnchor resolves against.

Java builds this from the chunk generator and the level, taking the narrower of the two vertical extents. Nothing here reads a level, so a caller supplies the three numbers.

Properties ​

genDepth ​

readonly genDepth: number

Defined in: surface/VerticalAnchor.ts:23

How many blocks the generator produces above minGenY.

minGenY ​

readonly minGenY: number

Defined in: surface/VerticalAnchor.ts:21

The lowest y the generator produces.

seaLevel ​

readonly seaLevel: number

Defined in: surface/VerticalAnchor.ts:25

The dimension's sea level.


WorldPreset ​

Defined in: dimension/WorldPreset.ts:10

One worldgen/world_preset document: the level stems a world starts with.

Properties ​

dimensions ​

readonly dimensions: ReadonlyMap<string, LevelStem>

Defined in: dimension/WorldPreset.ts:12

Stems keyed by dimension id. Always holds minecraft:overworld.


WorldgenDataSource ​

Defined in: WorldgenData.ts:9

The raw JSON documents of the three worldgen registries this package reads.

Properties ​

densityFunctions ​

readonly densityFunctions: ReadonlyMap<string, unknown>

Defined in: WorldgenData.ts:11

worldgen/density_function, keyed by identifier.

noises ​

readonly noises: ReadonlyMap<string, unknown>

Defined in: WorldgenData.ts:13

worldgen/noise, keyed by identifier.

noiseSettings ​

readonly noiseSettings: ReadonlyMap<string, unknown>

Defined in: WorldgenData.ts:15

worldgen/noise_settings, keyed by identifier.


XoroshiroRandomSourceState ​

Defined in: random/RandomSource.ts:51

JSON-safe state for XoroshiroRandomSource.

Properties ​

algorithm ​

readonly algorithm: "xoroshiro128++"

Defined in: random/RandomSource.ts:53

gaussian ​

readonly gaussian: GaussianCacheState

Defined in: random/RandomSource.ts:56

lanes ​

readonly lanes: readonly [number, number, number, number]

Defined in: random/RandomSource.ts:55

Unsigned high/low 32-bit lanes for the two 64-bit words.

version ​

readonly version: 1

Defined in: random/RandomSource.ts:52

Type Aliases ​

Axis ​

Axis = "x" | "y" | "z"

Defined in: density/DensityFunction.ts:2

The axis a gradient or slice function works along.


BinaryDensityType ​

BinaryDensityType = "add" | "div" | "max" | "min" | "mul" | "sub"

Defined in: density/DensityFunction.ts:25

The six two-input operators that take left and right.


BiomeClimateLookup ​

BiomeClimateLookup = (biome) => BiomeClimate

Defined in: biome/BiomeClimate.ts:18

Returns the climate of a biome identifier.

Parameters ​

biome ​

string

Returns ​

BiomeClimate


BiomeResolver ​

BiomeResolver = (quartX, quartY, quartZ) => string

Defined in: biome/BiomeSource.ts:9

Returns the biome identifier of one biome cell.

Parameters ​

quartX ​

number

quartY ​

number

quartZ ​

number

Returns ​

string


BiomeSourceDefinition ​

BiomeSourceDefinition = { preset: string; type: "minecraft:multi_noise"; } | { biomes: readonly MultiNoiseBiomeEntry[]; type: "minecraft:multi_noise"; } | { biome: string; type: "minecraft:fixed"; } | { biomes: readonly string[]; scale: number; type: "minecraft:checkerboard"; } | { type: "minecraft:the_end"; }

Defined in: dimension/parseBiomeSource.ts:28

The biome_source object of a minecraft:noise generator, one variant per Java biome source class.

A multi_noise source either names a worldgen/multi_noise_biome_source_parameter_list through preset or carries its climate boxes inline under biomes.


CarverConfig ​

CarverConfig = CaveCarverConfig | CanyonCarverConfig

Defined in: carver/Carver.ts:86

Either carver type 26.3 registers.


CarvingMaskVisitor ​

CarvingMaskVisitor = (localX, localZ, bottomY, topY) => void

Defined in: carver/CarvingMask.ts:17

Reports one run of open blocks in a column.

Parameters ​

localX ​

number

localZ ​

number

bottomY ​

number

topY ​

number

Returns ​

void


CaveSurface ​

CaveSurface = "floor" | "ceiling"

Defined in: surface/MaterialRule.ts:10

Which side of a solid run a stone_depth condition counts from.


CompiledSpline ​

CompiledSpline = (context, x, y, z) => number

Defined in: density/CubicSpline.ts:5

A compiled cubic spline, sampled the same way a density function is.

Parameters ​

context ​

SampleContext

x ​

number

y ​

number

z ​

number

Returns ​

number


ConditionEvaluator ​

ConditionEvaluator = () => boolean

Defined in: surface/MaterialRuleContext.ts:23

Returns whether a condition holds at the context's current position.

Returns ​

boolean


ContextDensityType ​

ContextDensityType = "beardifier" | "blend_alpha" | "blend_offset"

Defined in: density/DensityFunction.ts:31

The three operators whose value comes from the chunk being generated, not from the data.


DensityFunctionNode ​

DensityFunctionNode = { type: "constant"; value: number; } | { type: ContextDensityType; } | { type: "end_outer_islands"; } | { axis: Axis; fromCoordinate: number; fromValue: number; tiling: TilingMode; toCoordinate: number; toValue: number; type: "gradient"; } | { noise: string; shiftX: DensityFunctionNode; shiftY: DensityFunctionNode; shiftZ: DensityFunctionNode; type: "noise"; xzScale: number; yScale: number; } | { noise: string; type: "shift" | "shift_a" | "shift_b"; } | { smearScaleMultiplier: number; type: "old_blended_noise"; xzFactor: number; xzScale: number; yFactor: number; yScale: number; } | { metric: DistanceMetric; point: readonly [number, number, number]; type: "distance_to_point"; } | { input: DensityFunctionNode; type: "blend_density" | "cache"; } | { input: DensityFunctionNode; type: UnaryDensityType; } | { input: DensityFunctionNode; multiple: DensityFunctionNode; type: RoundingDensityType; } | { left: DensityFunctionNode; right: DensityFunctionNode; type: BinaryDensityType; } | { input: DensityFunctionNode; max: number; min: number; type: "clamp"; } | { cellHeight: number; density: DensityFunctionNode; lowerBound: number; type: "find_top_surface"; upperBound: DensityFunctionNode; } | { cellSizeXz: number; cellSizeY: number; input: DensityFunctionNode; type: "interpolated"; } | { functions: readonly DensityFunctionNode[]; input: DensityFunctionNode; thresholds: readonly number[]; type: "interval_select"; } | { alpha: DensityFunctionNode; first: DensityFunctionNode; second: DensityFunctionNode; type: "lerp"; } | { base: DensityFunctionNode; exponent: DensityFunctionNode; type: "pow"; } | { input: DensityFunctionNode; maxExclusive: number; minInclusive: number; type: "range_choice"; whenInRange: DensityFunctionNode; whenOutOfRange: DensityFunctionNode; } | { axis: Axis; coordinate: number; input: DensityFunctionNode; type: "slice"; } | { spline: SplineNode; type: "spline"; }

Defined in: density/DensityFunction.ts:59

One node of a parsed density function tree.

This mirrors the 44 types Java Edition 26.3 registers in minecraft:density_function_type. 1.21's flat_cache, cache_2d, cache_all_in_cell, cache_once, y_clamped_gradient, shifted_noise, weird_scaled_sampler, end_islands and old_blended_noise either merged into the types below or moved: caching became one value-neutral cache, the quantizing caches became slice and interpolated, shifted_noise became noise with optional shift inputs, and y_clamped_gradient became gradient with a tiling mode.


DensityFunctionResolver ​

DensityFunctionResolver = (id) => DensityFunctionNode

Defined in: density/parse.ts:14

Resolves a worldgen/density_function reference to its parsed tree.

Parameters ​

id ​

string

Returns ​

DensityFunctionNode


DensitySampler ​

DensitySampler = (context, x, y, z) => number

Defined in: density/compile.ts:19

A compiled density function: one closure that reads a position and the chunk context.

Parameters ​

context ​

SampleContext

x ​

number

y ​

number

z ​

number

Returns ​

number


DimensionCardinalLight ​

DimensionCardinalLight = "default" | "nether"

Defined in: dimension/DimensionType.ts:9

The directional shading a dimension's blocks get. Replaced the effects field in 25w45a.


DimensionSkybox ​

DimensionSkybox = "overworld" | "none" | "end"

Defined in: dimension/DimensionType.ts:6

The sky a dimension renders. Replaced the effects field in 25w45a.


DistanceMetric ​

DistanceMetric = "euclidean" | "euclidean_squared" | "manhattan" | "chebyshev"

Defined in: density/DensityFunction.ts:8

The distance measure a distance_to_point function uses.


FloatProvider ​

FloatProvider = { type: "constant"; value: number; } | { maxExclusive: number; min: number; type: "uniform"; } | { max: number; min: number; plateau: number; type: "trapezoid"; }

Defined in: carver/providers.ts:9

A single-precision value provider: a constant, a uniform draw or a trapezoid draw.


FluidPicker ​

FluidPicker = (x, y, z) => FluidStatus

Defined in: chunk/FluidPicker.ts:36

Chooses the fluid a position would hold if no aquifer overrode it.

Parameters ​

x ​

number

y ​

number

z ​

number

Returns ​

FluidStatus


GeneratorDefinition ​

GeneratorDefinition = NoiseGeneratorDefinition | FlatGeneratorDefinition | FlatPresetGeneratorDefinition | DebugGeneratorDefinition | UnknownGeneratorDefinition

Defined in: dimension/LevelStem.ts:58

The generator object of a level stem, a tagged union on type.


HeightProvider ​

HeightProvider = { type: "constant"; value: VerticalAnchor; } | { maxInclusive: VerticalAnchor; minInclusive: VerticalAnchor; type: "uniform"; }

Defined in: carver/providers.ts:22

A y level provider, which resolves its anchors against the dimension before drawing.


IntProvider ​

IntProvider = { type: "constant"; value: number; } | { maxInclusive: number; minInclusive: number; type: "uniform"; } | { maxInclusive: number; minInclusive: number; type: "biased_to_bottom"; } | { maxInclusive: number; minInclusive: number; type: "very_biased_to_bottom"; }

Defined in: carver/providers.ts:15

An integer value provider. The carvers use the constant and the two biased forms.


MaterialConditionNode ​

MaterialConditionNode = { biomes: readonly string[]; type: "biome"; } | { is3d: boolean; maxThreshold: number; minThreshold: number; noise: string; type: "noise_threshold"; } | { falseAtAndAbove: VerticalAnchor; randomName: string; trueAtAndBelow: VerticalAnchor; type: "vertical_gradient"; } | { addStoneDepth: boolean; anchor: VerticalAnchor; surfaceDepthMultiplier: number; type: "y_above"; } | { addStoneDepth: boolean; offset: number; surfaceDepthMultiplier: number; type: "water"; } | { type: "temperature"; } | { type: "steep"; } | { invert: MaterialConditionNode; type: "not"; } | { type: "hole"; } | { type: "above_preliminary_surface"; } | { addSurfaceDepth: boolean; offset: number; secondaryDepthRange: number; surfaceType: CaveSurface; type: "stone_depth"; }

Defined in: surface/MaterialRule.ts:31

One test a condition rule runs before its branch applies.

26.3 registers exactly these eleven types. bandlands, hole, steep and ore_vein are the four the vanilla overworld tree needs that no other TypeScript implementation has.


MaterialRuleNode ​

MaterialRuleNode = { resultState: string; type: "block"; } | { type: "bandlands"; } | { sequence: readonly MaterialRuleNode[]; type: "sequence"; } | { ifTrue: MaterialConditionNode; thenRun: MaterialRuleNode; type: "condition"; } | { rule: OreVeinRule; type: "ore_vein"; }

Defined in: surface/MaterialRule.ts:18

One node of a material rule tree, which earlier releases called a surface rule.

A rule returns a block state for a position or nothing, in which case the position keeps whatever the terrain pass left there. 26.3 registers exactly these five types.


NoiseNormalization ​

NoiseNormalization = "disabled" | "enabled" | "legacy"

Defined in: noise/NormalNoise.ts:13

How a noise's octave amplitudes are scaled before sampling.


OreVeinPlacer ​

OreVeinPlacer = (context, x, y, z) => string | undefined

Defined in: chunk/oreVein.ts:61

Returns the block an ore vein places at a position, or undefined to leave it alone.

Parameters ​

context ​

SampleContext

x ​

number

y ​

number

z ​

number

Returns ​

string | undefined


RandomSourceState ​

RandomSourceState = LegacyRandomSourceState | XoroshiroRandomSourceState

Defined in: random/RandomSource.ts:60

A saved state from either built-in Java random source.


RoundingDensityType ​

RoundingDensityType = "ceil" | "floor" | "round" | "truncate"

Defined in: density/DensityFunction.ts:28

The four rounding operators that take input and multiple.


RuleEvaluator ​

RuleEvaluator = (x, y, z) => string | undefined

Defined in: surface/MaterialRuleContext.ts:20

Returns the block a rule places at a position, or undefined to leave the position alone.

Parameters ​

x ​

number

y ​

number

z ​

number

Returns ​

string | undefined


SpawnDensitySampler ​

SpawnDensitySampler = (node, x, y, z) => number

Defined in: spawn/NoiseSpawnFinder.ts:14

A seeded density function sampled at one block position.

Parameters ​

node ​

DensityFunctionNode

x ​

number

y ​

number

z ​

number

Returns ​

number


SpawnTargetPoint ​

SpawnTargetPoint = readonly SpawnTargetFunction[]

Defined in: settings/NoiseGeneratorSettings.ts:92

The target point with the lowest climate fitness wins at each spawn candidate.


SplineNode ​

SplineNode = { kind: "constant"; value: number; } | { coordinate: DensityFunctionNode; derivatives: readonly number[]; kind: "multipoint"; locations: readonly number[]; values: readonly SplineNode[]; }

Defined in: density/DensityFunction.ts:34

A cubic spline, either a fixed value or a curve over another density function.

Union Members ​

Type Literal ​

{ kind: "constant"; value: number; }


Type Literal ​

{ coordinate: DensityFunctionNode; derivatives: readonly number[]; kind: "multipoint"; locations: readonly number[]; values: readonly SplineNode[]; }

coordinate ​

readonly coordinate: DensityFunctionNode

The density function whose value selects a point on the curve.

derivatives ​

readonly derivatives: readonly number[]

The slope used to extend the curve past each end knot.

kind ​

readonly kind: "multipoint"

locations ​

readonly locations: readonly number[]

Knot positions along the coordinate, in ascending order.

values ​

readonly values: readonly SplineNode[]

The value at each knot, itself a spline so curves can nest.


TemperatureModifier ​

TemperatureModifier = "none" | "frozen"

Defined in: biome/BiomeClimate.ts:7

How a biome bends its base temperature with position.


TilingMode ​

TilingMode = "clamp_to_edge" | "repeat" | "mirrored_repeat"

Defined in: density/DensityFunction.ts:5

How a gradient function behaves outside its coordinate range.


UnaryDensityType ​

UnaryDensityType = "abs" | "cube" | "half_negative" | "log" | "negate" | "quarter_negative" | "reciprocal" | "sign" | "sqrt" | "square" | "squeeze"

Defined in: density/DensityFunction.ts:11

The eleven single-input operators that take only input.


VerticalAnchor ​

VerticalAnchor = { type: "absolute"; y: number; } | { offset: number; type: "above_bottom"; } | { offset: number; type: "below_top"; } | { offset: number; type: "relative_to_sea_level"; }

Defined in: surface/VerticalAnchor.ts:7

A y level expressed relative to the dimension rather than as an absolute number.

The same four forms appear in material rules, height providers and feature placement, which is why they live beside the surface pass rather than inside it.

Variables ​

AIR ​

const AIR: "minecraft:air" = 'minecraft:air'

Defined in: chunk/FluidPicker.ts:4

The Java block state identifier for air, which this package treats as "no block".


AQUIFER_SEED ​

const AQUIFER_SEED: "minecraft:aquifer" = 'minecraft:aquifer'

Defined in: chunk/ChunkSampler.ts:11

The registry name the aquifer random factory is keyed by.


BLENDED_NOISE_SEED ​

const BLENDED_NOISE_SEED: "minecraft:terrain" = 'minecraft:terrain'

Defined in: noise/BlendedNoise.ts:14

The registry name the random source for old blended noise is keyed by.


CARVER_RANGE ​

const CARVER_RANGE: 4 = 4

Defined in: carver/Carver.ts:22

How many chunks away from the target chunk a carver can start, in each direction.


CHUNK_SIZE ​

const CHUNK_SIZE: 16 = 16

Defined in: chunk/ChunkSampler.ts:14

The side length of a chunk column in blocks.


CLAY_BANDS_SEED ​

const CLAY_BANDS_SEED: "minecraft:clay_bands" = 'minecraft:clay_bands'

Defined in: surface/SurfaceSystem.ts:18

The registry name the clay band generator keys its random by.


CLIMATE_CHILDREN_PER_NODE ​

const CLIMATE_CHILDREN_PER_NODE: 19 = 19

Defined in: biome/Climate.ts:16

How many children Java gives a search tree node before it splits again.


CLIMATE_PARAMETER_COUNT ​

const CLIMATE_PARAMETER_COUNT: 7 = 7

Defined in: biome/Climate.ts:13

How many axes a parameter point spans: the six climate values plus the offset.


CLIMATE_QUANTIZATION_FACTOR ​

const CLIMATE_QUANTIZATION_FACTOR: 10000 = 10000

Defined in: biome/Climate.ts:10

The factor Java multiplies a climate coordinate by before truncating it to an integer.

Every comparison in this file runs on the quantized form, so a biome's parameter ranges and a sampled position meet on the same grid.


DENSITY_FUNCTION_TYPES ​

const DENSITY_FUNCTION_TYPES: readonly ["constant", "blend_alpha", "blend_offset", "beardifier", "noise", "end_outer_islands", "distance_to_point", "gradient", "shift_a", "shift_b", "shift", "abs", "square", "cube", "sqrt", "half_negative", "quarter_negative", "reciprocal", "negate", "squeeze", "log", "sign", "floor", "round", "ceil", "truncate", "add", "sub", "mul", "div", "min", "max", "pow", "spline", "lerp", "clamp", "range_choice", "interval_select", "cache", "blend_density", "interpolated", "slice", "find_top_surface", "old_blended_noise"]

Defined in: density/DensityFunction.ts:221

The 44 operator names Java Edition 26.3 registers, in registration order.


DIMENSION_MIN_Y ​

const DIMENSION_MIN_Y: -2032 = -2032

Defined in: chunk/Aquifer.ts:39

Java's DimensionType.MIN_Y, the lowest block a packed position can address.


END_BIOMES ​

const END_BIOMES: readonly ["minecraft:the_end", "minecraft:end_highlands", "minecraft:end_midlands", "minecraft:small_end_islands", "minecraft:end_barrens"]

Defined in: biome/BiomeSource.ts:178

The five biomes the end places, in the order TheEndBiomeSource reports them.


GOLDEN_RATIO_64 ​

const GOLDEN_RATIO_64: -7046029254386353131n = -7046029254386353131n

Defined in: random/randomSupport.ts:12

Java's RandomSupport.GOLDEN_RATIO_64, the odd constant the seed upgrade adds.


GRADIENTS ​

const GRADIENTS: readonly (readonly [number, number, number])[]

Defined in: noise/GradientNoise.ts:5

The 16 lattice gradients Java Edition's gradient noise uses, packed as [x, y, z] triples.


LAVA ​

const LAVA: "minecraft:lava" = 'minecraft:lava'

Defined in: chunk/FluidPicker.ts:7

The Java block state identifier for lava, which the deep fluid level uses.


LAVA_LEVEL ​

const LAVA_LEVEL: -54 = -54

Defined in: chunk/FluidPicker.ts:13

The y level below which the global picker switches from the sea fluid to lava.


MATERIAL_CONDITION_TYPES ​

const MATERIAL_CONDITION_TYPES: readonly ["biome", "noise_threshold", "vertical_gradient", "y_above", "water", "temperature", "steep", "not", "hole", "above_preliminary_surface", "stone_depth"]

Defined in: surface/MaterialRule.ts:75

Every material_condition type 26.3 registers.


MATERIAL_RULE_TYPES ​

const MATERIAL_RULE_TYPES: readonly ["block", "bandlands", "sequence", "condition", "ore_vein"]

Defined in: surface/MaterialRule.ts:72

Every material_rule type 26.3 registers.


ORE_VEIN_SEED ​

const ORE_VEIN_SEED: "minecraft:ore" = 'minecraft:ore'

Defined in: chunk/oreVein.ts:9

The registry name the ore vein random factory is keyed by.


OVERWORLD_STEM_ID ​

const OVERWORLD_STEM_ID: "minecraft:overworld" = 'minecraft:overworld'

Defined in: dimension/WorldPreset.ts:7

The stem every preset has to define.


SILVER_RATIO_64 ​

const SILVER_RATIO_64: 7640891576956012809n = 7640891576956012809n

Defined in: random/randomSupport.ts:15

Java's RandomSupport.SILVER_RATIO_64, the odd constant the seed upgrade exclusive-ors.


WATER ​

const WATER: "minecraft:water" = 'minecraft:water'

Defined in: chunk/FluidPicker.ts:10

The Java block state identifier for water, which aquifers compare against.


WAY_BELOW_MIN_Y ​

const WAY_BELOW_MIN_Y: -32512 = -32512

Defined in: chunk/Aquifer.ts:36

Java's DimensionType.WAY_BELOW_MIN_Y, the level that means "no fluid at all".


f32 ​

const f32: (x) => number = Math.fround

Defined in: math.ts:13

Rounds a number to the nearest IEEE 754 single-precision value.

Java's density samplers and noise samplers return float, and the generator rounds after every arithmetic step. Applying this after each step reproduces that rounding.

Returns the nearest single precision float representation of a number.

Parameters ​

x ​

number

A numeric expression.

Returns ​

number

Functions ​

asInt() ​

asInt(value): number

Defined in: random/randomSupport.ts:7

The 32-bit two's-complement wrap Java applies to every int operation.

Parameters ​

value ​

number

Returns ​

number


asLong() ​

asLong(value): bigint

Defined in: random/randomSupport.ts:4

The 64-bit two's-complement wrap Java applies to every long operation.

Parameters ​

value ​

bigint

Returns ​

bigint


binarySearch() ​

binarySearch(from, to, condition): number

Defined in: math.ts:79

Returns the first index in [from, to) for which condition holds, assuming the predicate is monotonic. Matches Java's Mth.binarySearch, which cubic splines use to find their interval.

Parameters ​

from ​

number

to ​

number

condition ​

(index) => boolean

Returns ​

number


biomeTemperature() ​

biomeTemperature(climate, x, y, z, seaLevel): number

Defined in: biome/BiomeClimate.ts:75

The temperature of a biome at one block position.

Above sea level plus 17 the value falls with height and with a fixed noise field, which is what puts a snow line partway up a mountain inside one biome.

Parameters ​

climate ​

BiomeClimate

x ​

number

y ​

number

z ​

number

seaLevel ​

number

Returns ​

number


carveChunk() ​

carveChunk(options): void

Defined in: carver/Carver.ts:532

Runs every carver of every chunk within eight chunks of the target chunk and records the blocks they open inside it.

A carver can start up to eight chunks away and still reach this one, so a chunk's caves are decided by 289 independent draws rather than by its own. Each draw is seeded from the world seed and the source chunk position, so the result does not depend on generation order.

Carver paths cannot match Bedrock Edition for the same seed, because Bedrock's generator is undocumented. They do match Java Edition exactly, and that is what the tests assert.

Parameters ​

options ​

CarveChunkOptions

Returns ​

void


carversFromNoiseBiome() ​

carversFromNoiseBiome(noiseBiome, carversOf): (sourceChunkX, sourceChunkZ) => readonly CarverConfig[]

Defined in: carver/Carver.ts:513

Picks a source chunk's carvers from its noise biome, the way Java's NoiseBasedChunkGenerator.getBiomeGenerationSettingsForCarver does.

Java asks the biome source for the cell at (minBlockX >> 2, 0, minBlockZ >> 2), which is the cell that holds the chunk's own corner. It does not go through BiomeManager, so the seeded jitter that moves a block's biome near an edge plays no part. Reading the jittered biome at (minBlockX, 0, minBlockZ) instead picks a different cell for some chunks, and a data pack whose neighboring biomes list different carvers then digs the wrong caves. It also costs a fuzzy lookup for each of the 289 source chunks around every carved chunk.

Parameters ​

noiseBiome ​

BiomeResolver

The biome source's cells, before any jitter.

carversOf ​

(biome) => readonly CarverConfig[]

The carvers one biome lists.

Returns ​

(sourceChunkX, sourceChunkZ) => readonly CarverConfig[]


clamp() ​

clamp(value, min, max): number

Defined in: math.ts:25

Clamps a value into [min, max].

Parameters ​

value ​

number

min ​

number

max ​

number

Returns ​

number


clampedMap() ​

clampedMap(value, fromMin, fromMax, toMin, toMax): number

Defined in: math.ts:62

Maps a value from one range to another, clamping the input fraction to [0, 1].

Parameters ​

value ​

number

fromMin ​

number

fromMax ​

number

toMin ​

number

toMax ​

number

Returns ​

number


climateFitness() ​

climateFitness(point, target): number

Defined in: biome/Climate.ts:125

The squared distance from a target to a parameter point, which is what "nearest biome" means.

Parameters ​

point ​

ClimateParameterPoint

target ​

ClimateTargetPoint

Returns ​

number


climatePoint() ​

climatePoint(value): ClimateParameter

Defined in: biome/Climate.ts:81

Builds a quantized range that covers one point.

Parameters ​

value ​

number

Returns ​

ClimateParameter


climateSpan() ​

climateSpan(min, max): ClimateParameter

Defined in: biome/Climate.ts:75

Builds a quantized range from two unquantized floats.

Parameters ​

min ​

number

max ​

number

Returns ​

ClimateParameter


climateTarget() ​

climateTarget(temperature, humidity, continentalness, erosion, depth, weirdness): ClimateTargetPoint

Defined in: biome/Climate.ts:84

Builds a target point from six unquantized floats, as Climate.target does.

Parameters ​

temperature ​

number

humidity ​

number

continentalness ​

number

erosion ​

number

depth ​

number

weirdness ​

number

Returns ​

ClimateTargetPoint


coldEnoughToSnow() ​

coldEnoughToSnow(climate, x, y, z, seaLevel): boolean

Defined in: biome/BiomeClimate.ts:84

Whether precipitation at a position falls as snow, which is Java's coldEnoughToSnow.

Parameters ​

climate ​

BiomeClimate

x ​

number

y ​

number

z ​

number

seaLevel ​

number

Returns ​

boolean


compileMaterialCondition() ​

compileMaterialCondition(node, context): ConditionEvaluator

Defined in: surface/MaterialRuleContext.ts:253

Compiles a material condition into a closure bound to one context.

Parameters ​

node ​

MaterialConditionNode

context ​

MaterialRuleContext

Returns ​

ConditionEvaluator

Throws ​

Never at sample time; an unknown type is rejected while parsing.


compileMaterialRule() ​

compileMaterialRule(node, context): RuleEvaluator

Defined in: surface/MaterialRuleContext.ts:342

Compiles a material rule tree into a closure bound to one context.

The tree is walked once here, so a whole chunk's surface pass is a chain of closures over the context rather than a repeated switch over the node types.

Parameters ​

node ​

MaterialRuleNode

context ​

MaterialRuleContext

Returns ​

RuleEvaluator


compileMultipointSpline() ​

compileMultipointSpline(spline): CompiledSpline

Defined in: density/CubicSpline.ts:26

Builds the sampler for a multipoint spline.

Between two knots the curve is the Hermite interpolant Java computes, and outside the end knots it continues along the end derivative. Every step is single precision, which matters because the overworld's offset, factor and jaggedness all come out of these curves.

Parameters ​

spline ​

MultipointSpline

Returns ​

CompiledSpline


compileOreVeinRule() ​

compileOreVeinRule(rule, compile, randomFactory): OreVeinPlacer

Defined in: chunk/oreVein.ts:70

Compiles an ore vein rule into a placer.

The three random draws happen in Java's order: one against the vein density, one against the richness, and one against the raw-ore chance. Reordering them changes which blocks the same seed produces even though the distribution stays the same.

Parameters ​

rule ​

OreVeinRule

compile ​

(node) => DensitySampler

randomFactory ​

PositionalRandomFactory

Returns ​

OreVeinPlacer


createBlendedNoiseFbmSet() ​

createBlendedNoiseFbmSet(random, parameters): BlendedNoiseFbmSet

Defined in: noise/BlendedNoise.ts:66

Draws the three octave stacks from one random source, in Java's order.

Parameters ​

random ​

RandomSource

parameters ​

BlendedNoiseParameters

Returns ​

BlendedNoiseFbmSet


createBlendedNoiseSampler() ​

createBlendedNoiseSampler(random, parameters): (x, y, z) => number

Defined in: noise/BlendedNoise.ts:86

Compiles an old_blended_noise density function into a position sampler.

The selector noise is shifted by 0.5, clamped to [0, 1] and used to interpolate between the two limit noises, which is the pre-1.18 terrain shape Java still ships for the nether, the caves preset and the floating islands preset.

Parameters ​

random ​

RandomSource

parameters ​

BlendedNoiseParameters

Returns ​

(x, y, z) => number


createClimateSampler() ​

createClimateSampler(randomState, context?): ClimateSampler

Defined in: biome/ClimateSampler.ts:27

Builds the climate sampler for a seed and a dimension.

Parameters ​

randomState ​

RandomState

context? ​

SampleContext = ...

The memo slots the compiled density functions share. Pass a fresh one per region walked, or leave it out for an independent sampler.

Returns ​

ClimateSampler


createDisabledAquifer() ​

createDisabledAquifer(fluidPicker): Aquifer

Defined in: chunk/Aquifer.ts:100

The aquifer a dimension without an aquifers block uses: the global fluid and nothing else.

Parameters ​

fluidPicker ​

FluidPicker

Returns ​

Aquifer


createFbm() ​

createFbm(random, firstOctave, smearScaleY, valueFactor): NoiseStack

Defined in: noise/BlendedNoise.ts:35

Builds one fractal Brownian motion stack of smeared Perlin octaves, highest frequency first.

Parameters ​

random ​

RandomSource

firstOctave ​

number

smearScaleY ​

number

valueFactor ​

number

Returns ​

NoiseStack

Throws ​

When firstOctave is positive, which Java rejects.


createGlobalFluidPicker() ​

createGlobalFluidPicker(settings): FluidPicker

Defined in: chunk/FluidPicker.ts:45

Builds the dimension-wide fluid picker: the settings' fluid up to sea level, and lava below y -54.

Aquifers start from this and then decide, cell by cell, whether to raise, lower or remove the fluid surface.

Parameters ​

settings ​

NoiseGeneratorSettings

Returns ​

FluidPicker


createLegacyNetherFbm() ​

createLegacyNetherFbm(random, firstOctave, amplitudes): NoiseStack

Defined in: noise/LegacyFbmInitializer.ts:18

Builds the pre-1.18 octave chain the nether's temperature and vegetation noises still use.

The octaves are drawn from one random source from the highest frequency downward, and a zero-amplitude octave still consumes its draws, which is why the skip exists at all.

Parameters ​

random ​

RandomSource

firstOctave ​

number

amplitudes ​

readonly number[]

Returns ​

NoiseStack

Throws ​

When the amplitude list implies a positive octave, which Java rejects outright.


createNoiseAquifer() ​

createNoiseAquifer(config, compile, context, positionalRandomFactory, volume, globalFluidPicker): Aquifer

Defined in: chunk/Aquifer.ts:530

Builds the aquifer for one chunk extent from its parsed configuration.

Parameters ​

config ​

AquiferConfig

compile ​

(node) => DensitySampler

context ​

SampleContext

positionalRandomFactory ​

PositionalRandomFactory

volume ​

AquiferVolume

globalFluidPicker ​

FluidPicker

Returns ​

Aquifer


createWorldGenerationContext() ​

createWorldGenerationContext(settings): WorldGenerationContext

Defined in: surface/VerticalAnchor.ts:29

Builds the generation context a dimension's noise settings describe.

Parameters ​

settings ​
noiseSettings ​

{ height: number; minY: number; }

noiseSettings.height ​

number

noiseSettings.minY ​

number

seaLevel ​

number

Returns ​

WorldGenerationContext


densityInputsOf() ​

densityInputsOf(node): readonly DensityFunctionNode[]

Defined in: density/DensityFunction.ts:156

Lists the density functions a node reads, in the order its operands are written.

That is every operand, every noise shift input and every spline coordinate, so a walk that follows it reaches each node a sampler of the tree can evaluate. A node that reads nothing, such as a constant or a noise with its own coordinates, lists none.

Parameters ​

node ​

DensityFunctionNode

Returns ​

readonly DensityFunctionNode[]


findNoiseSpawnPosition() ​

findNoiseSpawnPosition(targets, sample): NoiseSpawnPosition

Defined in: spawn/NoiseSpawnFinder.ts:46

Ports Java 26.3's NoiseSpawnFinder, including its coarse-to-fine spiral order and strict tie handling. A caller with no spawn targets must use the generator's base origin instead.

Parameters ​

targets ​

readonly SpawnTargetPoint[]

sample ​

SpawnDensitySampler

Returns ​

NoiseSpawnPosition


floor() ​

floor(value): number

Defined in: math.ts:16

Math.floor as a 32-bit integer, matching Java's (int) Math.floor(v).

Parameters ​

value ​

number

Returns ​

number


floorDiv() ​

floorDiv(a, b): number

Defined in: math.ts:19

Floored division, matching Java's Math.floorDiv.

Parameters ​

a ​

number

b ​

number

Returns ​

number


floorMod() ​

floorMod(a, b): number

Defined in: math.ts:22

Floored modulus, matching Java's Math.floorMod: the result takes the divisor's sign.

Parameters ​

a ​

number

b ​

number

Returns ​

number


inverseLerp() ​

inverseLerp(value, min, max): number

Defined in: math.ts:55

The fraction of the way value lies between min and max, unclamped.

Parameters ​

value ​

number

min ​

number

max ​

number

Returns ​

number


isStartChunk() ​

isStartChunk(config, random): boolean

Defined in: carver/Carver.ts:464

Whether a chunk starts this carver, which is the first draw the carver's random makes.

Parameters ​

config ​

CarverConfig

random ​

RandomSource

Returns ​

boolean


javaStringHashCode() ​

javaStringHashCode(value): number

Defined in: random/randomSupport.ts:82

Java's String.hashCode, which the legacy positional factory uses in place of MD5.

Parameters ​

value ​

string

Returns ​

number


largeFeatureRandom() ​

largeFeatureRandom(seed, chunkX, chunkZ): RandomSource

Defined in: carver/Carver.ts:473

Seeds the random of one carver in one source chunk, which is Java's WorldgenRandom.setLargeFeatureSeed.

Parameters ​

seed ​

bigint

The world seed plus the carver's index in the biome's carver list.

chunkX ​

number

chunkZ ​

number

Returns ​

RandomSource


lerp() ​

lerp(alpha, from, to): number

Defined in: math.ts:52

Double-precision linear interpolation.

Parameters ​

alpha ​

number

from ​

number

to ​

number

Returns ​

number


lerp2F() ​

lerp2F(alphaX, alphaY, x00, x10, x01, x11): number

Defined in: math.ts:32

Single-precision bilinear interpolation over the four corners of a square.

Parameters ​

alphaX ​

number

alphaY ​

number

x00 ​

number

x10 ​

number

x01 ​

number

x11 ​

number

Returns ​

number


lerp3F() ​

lerp3F(alphaX, alphaY, alphaZ, x000, x100, x010, x110, x001, x101, x011, x111): number

Defined in: math.ts:36

Single-precision trilinear interpolation over the eight corners of a cell.

Parameters ​

alphaX ​

number

alphaY ​

number

alphaZ ​

number

x000 ​

number

x100 ​

number

x010 ​

number

x110 ​

number

x001 ​

number

x101 ​

number

x011 ​

number

x111 ​

number

Returns ​

number


lerpF() ​

lerpF(alpha, from, to): number

Defined in: math.ts:29

Single-precision linear interpolation, matching Java's Mth.lerp(float, float, float).

Parameters ​

alpha ​

number

from ​

number

to ​

number

Returns ​

number


map() ​

map(value, fromMin, fromMax, toMin, toMax): number

Defined in: math.ts:58

Maps a value from one range to another without clamping, matching Java's Mth.map.

Parameters ​

value ​

number

fromMin ​

number

fromMax ​

number

toMin ​

number

toMax ​

number

Returns ​

number


memoizeBiomeResolver() ​

memoizeBiomeResolver(resolver): BiomeResolver

Defined in: biome/BiomeSource.ts:35

Wraps a resolver so each biome cell is resolved once.

Java never asks a biome source the same cell twice: createBiomes fills the chunk's biome array, and every later stage reads that array. This server's stages call the source directly, and the surface pass calls it per block, which made a multi-noise lookup, six density functions and all their noise octaves run 98304 times per chunk for 1536 distinct answers.

The cache is direct-mapped: a cell hashes to one slot and a colliding cell evicts the previous occupant. The stored coordinates are compared exactly before a value is reused, so an eviction costs a recomputation and never an answer.

Parameters ​

resolver ​

BiomeResolver

Returns ​

BiomeResolver


mixStafford13() ​

mixStafford13(value): bigint

Defined in: random/randomSupport.ts:28

Stafford's variant 13 mix, the avalanche step Java runs over each half of an upgraded seed.

Parameters ​

value ​

bigint

Returns ​

bigint


mthCos() ​

mthCos(angle): number

Defined in: carver/trig.ts:35

Java's Mth.cos: the same table read a quarter turn along.

Parameters ​

angle ​

number

Returns ​

number


mthSin() ​

mthSin(angle): number

Defined in: carver/trig.ts:32

Java's Mth.sin: a table lookup, not Math.sin.

Parameters ​

angle ​

number

Returns ​

number


normalizeIdentifier() ​

normalizeIdentifier(value): string

Defined in: identifier.ts:11

Expands a registry reference to its namespace:path form.

Java's data files leave the namespace off minecraft entries in some places and spell it out in others, so every lookup in this package goes through here first.

Parameters ​

value ​

unknown

Returns ​

string

Throws ​

When the reference is not a string, or contains characters an identifier cannot hold.


parseBiomeClimate() ​

parseBiomeClimate(source, path?): BiomeClimate

Defined in: biome/BiomeClimate.ts:26

Reads the climate fields out of a worldgen/biome document.

Parameters ​

source ​

unknown

path? ​

string = '<biome>'

Returns ​

BiomeClimate

Throws ​

When temperature is missing or temperature_modifier names something other than none or frozen.


parseBiomeSource() ​

parseBiomeSource(definition, parameterLists, path?, sharedParameterLists?): BiomeSource

Defined in: dimension/parseBiomeSource.ts:103

Builds the biome source a definition describes.

A multi_noise preset resolves through parameterLists, keyed by the multi_noise_biome_source_parameter_list id. The datapack's own two list files are stubs that only name the preset again, so callers pass the data generator's reports/biome_parameters documents, which MultiNoiseBiomeSource.fromJson reads.

Parameters ​

definition ​

BiomeSourceDefinition

parameterLists ​

ReadonlyMap<string, unknown>

Raw parameter list documents, keyed by identifier.

path? ​

string = '<biome_source>'

Where the definition came from, for error messages.

sharedParameterLists? ​

ReadonlyMap<string, SharedArrayBuffer>

Optional immutable tables keyed by preset identifier.

Returns ​

BiomeSource

Throws ​

When a preset is not in parameterLists, or the type is not a Java biome source.


parseBiomeSourceDefinition() ​

parseBiomeSourceDefinition(json, path?): BiomeSourceDefinition

Defined in: dimension/parseBiomeSource.ts:57

Reads the biome_source JSON of a minecraft:noise generator into a definition.

Parameters ​

json ​

unknown

path? ​

string = '<biome_source>'

Where the document came from, for error messages.

Returns ​

BiomeSourceDefinition

Throws ​

When type is not one of the four Java biome sources, or a variant lacks its field.


parseCarver() ​

parseCarver(source, path?): CarverConfig

Defined in: carver/Carver.ts:99

Reads one worldgen/carver document.

26.3 flattened the config object the older schema wrapped these fields in, so a loader written against 1.21 data does not read this.

Parameters ​

source ​

unknown

path? ​

string = '<carver>'

Returns ​

CarverConfig

Throws ​

When the type is unknown or a field is missing.


parseClimateParameterPoint() ​

parseClimateParameterPoint(source, path?): ClimateParameterPoint

Defined in: biome/Climate.ts:870

Reads one parameters object of a multi_noise_biome_source_parameter_list document or of a reports/biome_parameters entry. Each axis may be a number, {min, max} or [min, max].

Parameters ​

source ​

unknown

path? ​

string = '<parameters>'

Returns ​

ClimateParameterPoint

Throws ​

When an axis is missing or has the wrong shape.


parseDensityFunction() ​

parseDensityFunction(source, resolve, path?): DensityFunctionNode

Defined in: density/parse.ts:118

Reads one worldgen/density_function JSON document into a tree.

A bare number is a constant and a bare string is a reference, both of which Java accepts anywhere a function is expected. References are resolved eagerly through resolve, so the returned tree has no indirection left for the compiler to chase.

Parameters ​

source ​

unknown

resolve ​

DensityFunctionResolver

Looks up another density function by identifier.

path? ​

string = '<root>'

Returns ​

DensityFunctionNode

Throws ​

When a type is unknown, a field is missing, or a value has the wrong shape. Nothing falls back to zero, because a silently zeroed subtree changes terrain without failing.


parseDimensionType() ​

parseDimensionType(json, path?): DimensionTypeDefinition

Defined in: dimension/DimensionType.ts:80

Reads one dimension_type JSON document.

min_y, height, logical_height, coordinate_scale, has_skylight, has_ceiling, ambient_light, monster_spawn_light_level, monster_spawn_block_light_limit and infiniburn are required, as in Java. has_fixed_time and has_ender_dragon_fight default to false, skybox to overworld, cardinal_light to default, timelines and attributes to empty, and default_clock stays absent.

Parameters ​

json ​

unknown

path? ​

string = '<dimension_type>'

Where the document came from, for error messages.

Returns ​

DimensionTypeDefinition

Throws ​

When a required field is missing, a field has the wrong shape, or the vertical bounds fall outside Java's limits.


parseFlatGeneratorSettings() ​

parseFlatGeneratorSettings(json, path?): FlatGeneratorSettings

Defined in: dimension/FlatGeneratorSettings.ts:45

Reads the settings object of a minecraft:flat generator.

Java spells a layer's thickness height; this server's config calls the same number size, which is why the parsed field keeps Java's name.

Parameters ​

json ​

unknown

path? ​

string = '<flat_settings>'

Where the document came from, for error messages.

Returns ​

FlatGeneratorSettings

Throws ​

When layers is missing or a layer lacks a block or a valid height.


parseFloatProvider() ​

parseFloatProvider(source, path?): FloatProvider

Defined in: carver/providers.ts:37

Reads a float provider, which Java writes as a bare number for the constant case.

Parameters ​

source ​

unknown

path? ​

string = '<float_provider>'

Returns ​

FloatProvider

Throws ​

When the type is unknown or a bound is missing.


parseGeneratorDefinition() ​

parseGeneratorDefinition(json, path?): GeneratorDefinition

Defined in: dimension/LevelStem.ts:82

Reads the generator object of a level stem.

A minecraft:flat generator's settings is either the settings object or a flat_level_generator_preset id; the id is normalized and kept as a string.

Parameters ​

json ​

unknown

path? ​

string = '<generator>'

Where the document came from, for error messages.

Returns ​

GeneratorDefinition

Throws ​

When type is missing, or a known kind lacks its fields.


parseHeightProvider() ​

parseHeightProvider(source, path?): HeightProvider

Defined in: carver/providers.ts:86

Reads a height provider.

Parameters ​

source ​

unknown

path? ​

string = '<height_provider>'

Returns ​

HeightProvider

Throws ​

When the type is unknown or an anchor is missing.


parseIntProvider() ​

parseIntProvider(source, path?): IntProvider

Defined in: carver/providers.ts:66

Reads an integer provider, which Java writes as a bare number for the constant case.

Parameters ​

source ​

unknown

path? ​

string = '<int_provider>'

Returns ​

IntProvider

Throws ​

When the type is unknown or a bound is missing.


parseLevelStem() ​

parseLevelStem(json, path?): LevelStem

Defined in: dimension/LevelStem.ts:117

Reads one level stem, as found under dimensions in a worldgen/world_preset document or on its own at data/<namespace>/dimension/<name>.json.

Parameters ​

json ​

unknown

path? ​

string = '<dimension>'

Where the document came from, for error messages.

Returns ​

LevelStem

Throws ​

When type or generator is missing or malformed.


parseNoiseGeneratorSettings() ​

parseNoiseGeneratorSettings(source, resolve, path?): NoiseGeneratorSettings

Defined in: settings/NoiseGeneratorSettings.ts:136

Reads one worldgen/noise_settings JSON document.

Parameters ​

source ​

unknown

resolve ​

DensityFunctionResolver

Looks up a referenced density function by identifier.

path? ​

string = '<noise_settings>'

Returns ​

NoiseGeneratorSettings

Throws ​

When a required field is missing or has the wrong shape. The router's eight slots, noise, sea_level, default_block, default_fluid, material_rule, disable_mob_generation and legacy_random_source are all required, as in Java.


parseNoiseParameters() ​

parseNoiseParameters(source): NoiseParameters

Defined in: noise/NormalNoise.ts:67

Reads one worldgen/noise JSON document.

Parameters ​

source ​

unknown

Returns ​

NoiseParameters

Throws ​

When a field is missing, has the wrong type, or when amplitude_modifiers is present with a length other than octave_count, which is the validation Java applies.


parseOreVeinRule() ​

parseOreVeinRule(source, resolve, path?): OreVeinRule

Defined in: chunk/oreVein.ts:39

Reads one minecraft:ore_vein material rule.

1.21 drove ore veins from three noise router slots named vein_toggle, vein_ridged and vein_gap; 26.3 moved them into this rule, which the surface pass evaluates. The density functions themselves still live in worldgen/density_function/overworld/ore_vein/.

Parameters ​

source ​

unknown

resolve ​

(reference, path) => DensityFunctionNode

Looks up a referenced density function by identifier.

path? ​

string = '<ore_vein>'

Returns ​

OreVeinRule

Throws ​

When a field is missing or has the wrong shape.


parseVerticalAnchor() ​

parseVerticalAnchor(source, path?): VerticalAnchor

Defined in: surface/VerticalAnchor.ts:64

Reads a vertical_anchor value, which Java writes as a one-key object.

Parameters ​

source ​

unknown

path? ​

string = '<vertical_anchor>'

Returns ​

VerticalAnchor

Throws ​

When the object does not hold exactly one of the four known keys.


parseWorldPreset() ​

parseWorldPreset(json, path?): WorldPreset

Defined in: dimension/WorldPreset.ts:21

Reads one worldgen/world_preset JSON document.

Parameters ​

json ​

unknown

path? ​

string = '<world_preset>'

Where the document came from, for error messages.

Returns ​

WorldPreset

Throws ​

When dimensions is missing, a stem is malformed, or minecraft:overworld is absent.


positionalSeed() ​

positionalSeed(x, y, z): bigint

Defined in: random/randomSupport.ts:74

Java's Mth.getSeed: the position hash both positional factories mix into their state.

The x * 3129871 term overflows as a 32-bit int before it widens, which is why this truncates that product rather than computing it in 64 bits.

Parameters ​

x ​

number

y ​

number

z ​

number

Returns ​

bigint


quantize() ​

quantize(value, resolution): number

Defined in: math.ts:73

Rounds a value down to the nearest multiple of resolution, matching Java's Mth.quantize.

Parameters ​

value ​

number

resolution ​

number

Returns ​

number


quantizeClimateCoord() ​

quantizeClimateCoord(coord): number

Defined in: biome/Climate.ts:26

Quantizes a climate coordinate the way Climate.quantizeCoord does.

The multiplication is single precision in Java and the cast truncates toward zero, so both steps are reproduced here. Quantized values never leave [-20000, 20000], and a squared distance over seven axes stays under 2^53, which is why this package keeps them as numbers rather than as the long Java uses.

Parameters ​

coord ​

number

Returns ​

number


quartFromBlock() ​

quartFromBlock(block): number

Defined in: math.ts:96

Converts a block coordinate to the biome-cell (quart) coordinate that contains it.

Parameters ​

block ​

number

Returns ​

number


quartToBlock() ​

quartToBlock(quart): number

Defined in: math.ts:99

Converts a biome-cell (quart) coordinate to the block coordinate of its minimum corner.

Parameters ​

quart ​

number

Returns ​

number


randomBetween() ​

randomBetween(nextFloat, min, maxExclusive): number

Defined in: carver/trig.ts:38

Java's Mth.randomBetween: a single-precision draw in [min, maxExclusive).

Parameters ​

nextFloat ​

number

min ​

number

maxExclusive ​

number

Returns ​

number


resolveAnchorY() ​

resolveAnchorY(anchor, context): number

Defined in: surface/VerticalAnchor.ts:39

Resolves an anchor to a y level.

Parameters ​

anchor ​

VerticalAnchor

context ​

WorldGenerationContext

Returns ​

number


sampleFloat() ​

sampleFloat(provider, random): number

Defined in: carver/providers.ts:103

Draws one value from a float provider, consuming the draws Java consumes.

Parameters ​

provider ​

FloatProvider

random ​

RandomSource

Returns ​

number


sampleHeight() ​

sampleHeight(provider, random, context): number

Defined in: carver/providers.ts:145

Draws one y level from a height provider.

Parameters ​

provider ​

HeightProvider

random ​

RandomSource

context ​

WorldGenerationContext

Returns ​

number


sampleInt() ​

sampleInt(provider, random): number

Defined in: carver/providers.ts:121

Draws one value from an integer provider, consuming the draws Java consumes.

Parameters ​

provider ​

IntProvider

random ​

RandomSource

Returns ​

number


seedFromHashOf() ​

seedFromHashOf(name): Seed128bit

Defined in: random/randomSupport.ts:63

Hashes a name into a 128-bit state the way Java does: the MD5 digest of its UTF-8 bytes, read as two big-endian 64-bit halves.

Parameters ​

name ​

string

Returns ​

Seed128bit


shouldMeltFrozenOceanIcebergSlightly() ​

shouldMeltFrozenOceanIcebergSlightly(climate, x, y, z, seaLevel): boolean

Defined in: biome/BiomeClimate.ts:88

Whether a frozen ocean's icebergs sit two blocks lower here than their noise asks for.

Parameters ​

climate ​

BiomeClimate

x ​

number

y ​

number

z ​

number

seaLevel ​

number

Returns ​

boolean


smoothstep() ​

smoothstep(x): number

Defined in: math.ts:70

Perlin's quintic fade curve, in single precision.

Parameters ​

x ​

number

Returns ​

number


typeName() ​

typeName(value): string

Defined in: identifier.ts:21

Strips the minecraft: prefix from a type name so a switch can match the short form.

Parameters ​

value ​

unknown

Returns ​

string


unquantizeClimateCoord() ​

unquantizeClimateCoord(coord): number

Defined in: biome/Climate.ts:30

The inverse of quantizeClimateCoord, used when reporting a sampled value.

Parameters ​

coord ​

number

Returns ​

number


upgradeSeedTo128bit() ​

upgradeSeedTo128bit(legacySeed): Seed128bit

Defined in: random/randomSupport.ts:42

Spreads one 64-bit world seed into the 128-bit state Xoroshiro128++ starts from.

Parameters ​

legacySeed ​

bigint

Returns ​

Seed128bit


upgradeSeedTo128bitUnmixed() ​

upgradeSeedTo128bitUnmixed(legacySeed): Seed128bit

Defined in: random/randomSupport.ts:36

Spreads one 64-bit world seed into the unmixed 128-bit pair, before the avalanche step.

Parameters ​

legacySeed ​

bigint

Returns ​

Seed128bit


wrap() ​

wrap(value): number

Defined in: noise/GradientNoise.ts:39

Folds a coordinate back toward the origin once it grows large enough that a double can no longer separate neighboring lattice cells. Java calls this GradientNoise.wrap; without it the far lands reappear.

Parameters ​

value ​

number

Returns ​

number


xorSeed() ​

xorSeed(seed, lo, hi): Seed128bit

Defined in: random/randomSupport.ts:48

Exclusive-ors a 128-bit state with another, which is how a positional factory keys a name.

Parameters ​

seed ​

Seed128bit

lo ​

bigint

hi ​

bigint

Returns ​

Seed128bit