Guide 1 Docs 2 Reference 3
11

Field type

A number at every block, as a recipe the engine works out. Sums (+ - * / ^ and unary minus) and the methods make new fields; a plain number is a field too. A field above 0.5 is "true" where a rule asks a question.

Functions 11

field:abs() → Field

field:floor() → Field

field:sqrt() → Field

field:min(other: Field | number) → Field

field:max(other: Field | number) → Field

field:gt(other: Field | number) → Field

1 where this is the larger, else 0.

field:lt(other: Field | number) → Field

1 where this is the smaller, else 0.

field:clamp(low: number, high: number) → Field

field:smooth(from: number, to: number) → Field

0 at from, 1 at to, smooth between. from may be the larger.

field:curve(points: { { number } }) → Field

Straight lines through { { input, output }, ... }, inputs rising.

field:at(dx: number, dy: number, dz: number) → Field

This field read dx, dy, dz blocks away: fields.water:at(1, 0, 0) is the water east of here.