Guide 1 Docs 2 Reference 3
13

fields global

Recipes for numbers over the world, for world.generate.

Docs: World

Functions 4

fields.noise(opts: { seed: number?, scale: number?, octaves: number?, gain: number?, lacunarity: number?, solid: boolean? }?) → Field

Smooth noise, about -1..1. solid = true changes with y too.

fields.mix(a: Field | number, b: Field | number, t: Field | number) → Field

a where t is 0, b where it is 1.

fields.hash(cell: number?, seed: number?) → Field

One number 0..1 for each square of cell blocks (1).

fields.cells(size: number, seed: number?) → { distance: Field, random: Field }

A scattered grid, one point per size blocks: the distance to the nearest point, and that point's own number 0..1.

Fields 9

fields.x: Field

fields.y: Field

fields.z: Field

fields.height: Field

The y of the surface of a column, as a block.

fields.slope: Field

The step to the steepest of the four columns beside this one.

fields.water: Field

How deep the water is over the surface; 0 and below on land.

fields.shore: Field

1 on a column at the water's edge with water beside it.

fields.depth: Field

Blocks under the surface: fields.height - fields.y.

fields.room: Field

The height of the open space a block is in: 0 in rock, 64 at most (and in the open sky). density cannot use it.