Call as
Conditions.build.imbueObservation(value, cache)
Record the dependency Conditions.build.imbueObservation, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.
What it does
Reads the temporary enchant ID on the main hand, or the off hand when value.offhand is set, for the WEAPON_IMBUE condition. Uses the cached GetWeaponEnchantInfo, or the platform's composed reader on clients with C_PaperDollInfo.GetTemporaryEnchantmentInfo, and returns false when that hand has no temporary enchant.
Arguments
| Name | Type | What it does |
|---|---|---|
value | table | Condition settings; a truthy offhand field selects the off hand. |
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
Returns
| 1 | number | boolean | nil | Enchant ID of the temporary enchant, false when the hand has none, or nil when it cannot be read. |
|---|---|---|
| 2 | string | nil | Reason for nil: missing-api, api-error, restricted-value or invalid-weapon-observation. |
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.
- Not available on that edition (the reason is in the tooltip)
- Only while Blizzard's deprecation fallbacks are on
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.
How the addon calls it
- Weapon Enchant Type (evaluate)
local id, reason = imbueObservation(value, cache)
Dependencies
Functions.cache.getCached→Functions.cache.getCachedFunctions.presentation.nullable→Functions.presentation.nullableFunctions.values.compare→Functions.values.compareFunctions.values.isin→Functions.values.isin
Source
Conditions/build.lua, line 88. Read only in game; Duplicate makes an editable copy.
Conditions.build.imbueObservation(value, cache)
local reader = GetWeaponEnchantInfo
if C_PaperDollInfo and C_PaperDollInfo.GetTemporaryEnchantmentInfo then reader = addon.Platform.ComposedWeaponEnchantInfo end
if type(reader) ~= "function" then return nil, "missing-api" end
---@diagnostic disable-next-line: unbalanced-assignments
local ok, main, _, _, mainID, off, _, _, offID = pcall(Functions.cache.getCached, cache, reader)
if not ok then return nil, "api-error" end
local enchanted, id = main, mainID
if value.offhand then enchanted, id = off, offID end
if not addon.Platform:CanReadValue(enchanted) or not addon.Platform:CanReadValue(id) then return nil, "restricted-value" end
if enchanted == nil or enchanted == false or enchanted == 0 then return false end
if type(id) ~= "number" then return nil, "invalid-weapon-observation" end
return id




