entity.floor_dist

Distance to the nearest block or terrain surface below the entity.

Range:

> 0 - distance to the floor
< 0 - no floor found

Type:

var, read-only

Remarks:

This value is internally set by the static light and shadow calculation and can be used for the movement script. It is only valid if the entity is not unlit, and the nearest level or block surface below is within the floor_range.

Example:

if(my.floor_dist <0)

{ent_remove(my);}

See also:

entity.unlit, floor_range