Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

findGroundMaterial

findGroundMaterial(world, position, options?): string | undefined

The material of the ground’s cell under position, after every GroundPaint over it, such as "dirt" on a tilled plot: for a footstep’s sound, or a rule that asks what grows where. A cell shows the map’s overlay where its blend is over one half, as a paint’s replace reads it, and its base otherwise; the paint with the highest sortOrder that lays the cell draws over both. A paint lands as its component commits, after the state it mounts from, so a rule that decides an outcome reads that state rather than the paint. Undefined where no Landscape stands, or off the map; throws where two stand and options names no ground.

Parameter Type Default value
world World undefined
position GroundPosition undefined
options GroundMaterialOptions noOptions

string | undefined