Call as
addon.Platform:GetHealthForecastProviderObservation(unit)
Available directly through addon; no dependency is needed.
What it does
Read optional RealMobHealth using its exact one-argument dot call. Absent nil/false namespace returns an empty record. Normalize current and maximum independently: nil/false fields permit native fallback, numeric zero remains present. Malformed, failed, restricted, negative or nonfinite consumed provider facts are unavailable. No provider or stale fallback cache is used.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (implicit with colon calls). |
unit | string | Selected unit token forwarded as the only provider argument. |
Returns
| 1 | table | nil | Partial current/maximum record, empty when provider absent, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Provider, validation or observation availability reason. |
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
It reads no game API directly.
Secret values (Retail and Forever)
On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.
Example
local record = addon.Platform:GetHealthForecastProviderObservation("target")
if not record or not record.current or not record.maximum then return nil end
if record.maximum == 0 then return nil end
return record.current / record.maximum < 0.2Dependencies
providerValue→Platform.health_forecast.providerValuereadField→Platform.health_forecast.readField
Source
Platform/health_forecast.lua, line 107. Read only in game; Duplicate makes an editable copy.
Platform.health_forecast.GetHealthForecastProviderObservation(self, unit)
local policy=self:GetCombatDataPolicy()
if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
if not self:CanReadValue(unit) then return nil,'restricted-value' end
if type(unit)~='string' or unit=='' then return nil,'invalid-unit' end
local provider=_G.RealMobHealth
if not self:CanReadValue(provider) then return nil,'restricted-value' end
if provider==nil or provider==false then return {} end
local api,why=readField(self,provider,'GetUnitHealth')
if why then return nil,why end
if type(api)~='function' then return nil,'missing-api' end
local ok,current,maximum=pcall(api,unit)
if not ok then return nil,'api-error' end
local value,reason=providerValue(self,current)
if reason then return nil,reason end
local max,maxReason=providerValue(self,maximum)
if maxReason then return nil,maxReason end
return {current=value,maximum=max}