Skip to content

Waters

Defined in: sdk/src/water/waterPlugin.ts:140

Run-time access to the water: where its surface is at a point, for what floats on it or swims in it.

new Waters(): Waters

Waters

baking: boolean = false

Defined in: sdk/src/water/waterPlugin.ts:154

Whether a bake is in hand: what is placed by the water waits for it.


quality: WaterQuality = FULL_WATER

Defined in: sdk/src/water/waterPlugin.ts:143

What the quality level allows now; the plugin refreshes it each frame, and what is drawn and what is answered both follow it.

get empty(): boolean

Defined in: sdk/src/water/waterPlugin.ts:165

Whether there is no water to ask about: nothing is baked, so depthAt answers null everywhere. A world laid out with no water at all is laid out the same here and on a worker, which “no data to hand over” alone does not say.

boolean

bodyAt(x, z): { bodyId: string; entity: number; form: number; level: number; } | null

Defined in: sdk/src/water/waterPlugin.ts:217

The body of water at (x, z) and its surface at rest, or null where there is none: which water a place belongs to, for what a game keeps per body (a fishing spot, a level it raises) and a placement that keeps by the shore.

number

number

{ bodyId: string; entity: number; form: number; level: number; } | null


depthAt(x, z, y): number | null

Defined in: sdk/src/water/waterPlugin.ts:170

How deep the water stands at rest over the world height y at (x, z): above zero under water, null where there is none.

number

number

number

number | null


disturb(x, y, z, radius, strength): boolean

Defined in: sdk/src/water/waterPlugin.ts:202

Disturbs the water at the world point (x, y, z): a bump of strength world units (negative is a dip) over radius, which spreads as a ring and leaves foam. Does nothing where there is no water or where the zone keeps no ripples.

number

number

number

number

number

boolean


heightAt(x, z): number | null

Defined in: sdk/src/water/waterPlugin.ts:241

The world height of the surface above or below (x, z), or null where there is none.

number

number

number | null


queryData(): WaterQueryData | null

Defined in: sdk/src/water/waterPlugin.ts:157

The baked water as data a worker can answer depthAt and shoreAt from, or null where none is baked.

WaterQueryData | null


rippleAt(x, _y, z): number

Defined in: sdk/src/water/waterPlugin.ts:209

The height the ripples add to the surface at the world point, where the zone keeps them; 0 elsewhere.

number

number

number

number


sample(x, y, z): WaterSample | null

Defined in: sdk/src/water/waterPlugin.ts:178

The surface over or under (x, y, z): how far above it the point is (negative under), the surface’s normal, the current, and the point on it straight above or below. Null where there is no water. The waves are read at the instant of the frame.

number

number

number

WaterSample | null


shoreAt(x, z): number | null

Defined in: sdk/src/water/waterPlugin.ts:230

How far (x, z) is from the water’s edge, across the ground: above zero on dry land (how far to the nearest water), below it on the water (how far in from its shore). Past the zone’s region it is the open sea’s, deep in; null where no water is baked at all.

number

number

number | null