altitude_sensor

Reports the sensor's world altitude, local air pressure, and vertical speed. Altitude is the world-frame Y coordinate of the block (projected out of any sub-level), so a sensor on a flying contraption reads the same value as a stationary block at the same global position.

getHeight()Get the sensor's current world altitude.
getAirPressure()Get the local air pressure at the sensor's altitude.
getVerticalSpeed()Get the sensor's current vertical speed.
getHeight()Source

Get the sensor's current world altitude.

Returns

  1. number The block's world-frame Y coordinate, in blocks (= meters in Minecraft units).
getAirPressure()Source

Get the local air pressure at the sensor's altitude.

Unit is dimensionless "atmosphere fraction": 1.0 = sea-level pressure, 0.0 = vacuum (top of build height). The goggle tooltip displays this value as a percentage (1.00 → "100.00%").

Computed as base_pressure × pressure_curve(y) where on the Overworld defaults base_pressure = 1.0 and the curve follows exp(-0.004 × (y - seaLevel)) above sea level (so a 1/e pressure drop every ~250 blocks of altitude), clamped to a maximum of 1.5 below sea level, and tapering to 0 at logicalHeight. Per-dimension curves can override this via Sable's physics config.

Returns

  1. number The air pressure as a fraction of sea-level pressure.
getVerticalSpeed()Source

Get the sensor's current vertical speed. Finite-differenced from getHeight at the server tick rate (Δheight × 20). Has one tick of lag. Server-side only — returns 0 on the client side or before the second tick after placement.

Returns

  1. number The vertical speed in m/s (positive = ascending).