Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

helix / BiomeDef

Class: BiomeDef โ€‹

Defined in: core/values/biome/def.ts:36

A biome definition, registered with Datapack.biome. Settings are version-agnostic; the IR shapes them for the target.

dp.biome("minecraft:plains", // override a vanilla biome new BiomeDef() .temperature(0.8).downfall(0.4).precipitation(true) .effects((e) => e .skyColor("#78a7ff").fogColor("#c0d8ff") .waterColor("#3f76e4").waterFogColor("#050533") .ambientSound(SoundEvent.AMBIENT_CAVE)) .spawn(SpawnCategory.CREATURE, EntityType.SHEEP, { weight: 12, min: 4, max: 4 }) .feature(DecorationStep.VEGETAL_DECORATION, "minecraft:patch_grass_plain"));

Constructors โ€‹

Constructor โ€‹

new BiomeDef(): BiomeDef

Returns โ€‹

BiomeDef

Properties โ€‹

s โ€‹

readonly s: DefState

Defined in: core/values/biome/def.ts:38

The biome settings, read by the IR when it renders the biome.

Methods โ€‹

attribute() โ€‹

attribute(id, value): this

Defined in: core/values/biome/def.ts:129

Sets an environment attribute directly (1.21.11+), for ones without a setter. Merged over effects; ignored on older versions.

Parameters โ€‹

id โ€‹

string

value โ€‹

unknown

Returns โ€‹

this


carver() โ€‹

carver(step, ...refs): this

Defined in: core/values/biome/def.ts:112

Adds configured carvers. step only matters before 1.21.2, when air and liquid carvers were separate.

Parameters โ€‹

step โ€‹

CarveStep

refs โ€‹

...WorldgenRef[]

Returns โ€‹

this


creatureSpawnProbability() โ€‹

creatureSpawnProbability(value): this

Defined in: core/values/biome/def.ts:75

Chance (0..0.9999999) that a chunk gets its passive mobs at world-gen time.

Parameters โ€‹

value โ€‹

number

Returns โ€‹

this


downfall() โ€‹

downfall(value): this

Defined in: core/values/biome/def.ts:57

Humidity, 0..1: drives foliage tint and fire spread.

Parameters โ€‹

value โ€‹

number

Returns โ€‹

this


effects() โ€‹

effects(build): this

Defined in: core/values/biome/def.ts:81

Configure the atmosphere (colours, particle, sounds, music).

Parameters โ€‹

build โ€‹

(effects) => void

Returns โ€‹

this


feature() โ€‹

feature(step, ...refs): this

Defined in: core/values/biome/def.ts:120

Add placed features to a generation step. Repeatable per step.

Parameters โ€‹

step โ€‹

DecorationStep

refs โ€‹

...WorldgenRef[]

Returns โ€‹

this


precipitation() โ€‹

precipitation(has): this

Defined in: core/values/biome/def.ts:63

Whether weather falls here at all (has_precipitation).

Parameters โ€‹

has โ€‹

boolean

Returns โ€‹

this


raw() โ€‹

raw(json): this

Defined in: core/values/biome/def.ts:135

Escape hatch: merge json over the built object (last word wins).

Parameters โ€‹

json โ€‹

Record<string, unknown>

Returns โ€‹

this


spawn() โ€‹

spawn(category, type, opts): this

Defined in: core/values/biome/def.ts:87

Add one natural-spawn entry to a mob category. Repeatable.

Parameters โ€‹

category โ€‹

SpawnCategory

type โ€‹

EntityType

opts โ€‹

SpawnerOpts

Returns โ€‹

this


spawnCost() โ€‹

spawnCost(type, opts): this

Defined in: core/values/biome/def.ts:100

A spawn_costs entry: density-limit type by potential-field charge.

Parameters โ€‹

type โ€‹

EntityType

opts โ€‹

SpawnCostOpts

Returns โ€‹

this


temperature() โ€‹

temperature(value): this

Defined in: core/values/biome/def.ts:51

Biome temperature: drives snow vs rain, grass tint and mob behaviour.

Parameters โ€‹

value โ€‹

number

Returns โ€‹

this


temperatureModifier() โ€‹

temperatureModifier(modifier): this

Defined in: core/values/biome/def.ts:69

frozen makes temperature vary by position (the frozen-ocean patches).

Parameters โ€‹

modifier โ€‹

TemperatureModifier

Returns โ€‹

this

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.