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
numberThe 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 defaultsbase_pressure = 1.0and the curve followsexp(-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 atlogicalHeight. Per-dimension curves can override this via Sable's physics config.Returns
numberThe air pressure as a fraction of sea-level pressure.
- getVerticalSpeed()Source
Get the sensor's current vertical speed. Finite-differenced from
getHeightat 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
numberThe vertical speed in m/s (positive = ascending).