Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Aura/Tint HealthColors API v2.0.0

1780236091

Edited 1780236178
MidNiteShadow7
Pro
API Scripter
Hi Ed, I've created an update that can be manually installed from here:&nbsp; <a href="https://www.dropbox.com/scl/fi/gteg92lz330dpk0wjujiz/HealthColors_v2.1.4.beta.1.zip?rlkey=pe35742kf9gwn0baqfj8w38uj&amp;dl=0" rel="nofollow">https://www.dropbox.com/scl/fi/gteg92lz330dpk0wjujiz/HealthColors_v2.1.4.beta.1.zip?rlkey=pe35742kf9gwn0baqfj8w38uj&amp;dl=0</a> As I am not a DM, I don't have games set up using those mods, but I will aim to create a test game later today or tomorrow if possible (working on a few other sites atm), and I will post when I have had a chance. But in the meantime, feel free to download the beta version linked above and see if it works on a copy of your game. Below is the current CHANGELOG: [2.1.4.beta.1] – 2026-05-31 · Milestone Fixed Fixed HealthColors not responding when HP is changed by an external script (e.g. AlterBars) that modifies the character attribute linked to a token bar rather than the token bar directly. Roll20 fires change:graphic too late in this path — prev.bar1_value already reflects the new value, so the early-return guard blocked every update. Added a dedicated change:attribute listener ( registerAttributeListener ) that fires reliably with genuine old/new values, verifies the token's bar is actually linked to the changed attribute, constructs a correct fakePrev , and calls handleToken with the real delta so aura/tint and dead-status update correctly. Fixed duplicate particle FX spawning when both the change:attribute and change:graphic listeners fire for the same HP change. The recentAttrFires Set tracks tokens recently handled by the attribute listener; the change:graphic wrapper ( handleTokenChange ) passes update='YES' for those tokens to suppress the redundant FX, and the marker is cleared after a 250 ms deduplication window. Fixed TokenMod's observer receiving the raw handleToken instead of handleTokenChange , causing TokenMod-triggered HP changes to bypass FX deduplication entirely. Fixed a race condition in applyAttrHpChange where two rapid HP changes within the 50 ms propagation window could cause the first timeout to overwrite the bar value already set by the second change. At timeout fire time the live bar value is now compared three ways: if it matches newVal Roll20 already propagated it (skip the set); if it matches neither oldVal nor newVal a concurrent change has landed (bail entirely); only if it still equals oldVal is the bar written. Fixed add:graphic handler: corrected from change:graphic to add:graphic in registerEventHandlers and added a null guard so the delayed token lookup safely handles tokens deleted before the 400 ms fires. Changed Extracted four input-normalization helpers ( normalizePercent , normalizePositiveNumber , normalizeYesNoOff , normalizeTrackName ) and applied them throughout handleInput , replacing ad-hoc inline validation with consistent, tested helpers. JSDoc corrections: applyDeadStatus.prevValue type widened to {number|string} ; toggleBtn and boolPill background-color descriptions corrected from green/red to blue/red (the true/false button background is #6FAEC7 , not green); registerEventHandlers bullet list updated to name handleTokenChange and add:graphic correctly.
Thanks. Appreciate all you have done
Ed W. said: Thanks. Appreciate all you have done Please let me know if that fix has worked for you. If not, I'll take another look at the code.
Hey MidNite, &nbsp;Sorry the fix didn't work. Still doesn't detect if the hit points are reduced by another macro like alterbars
Ed W. said: Hey MidNite, &nbsp;Sorry the fix didn't work. Still doesn't detect if the hit points are reduced by another macro like alterbars Can you create a copy of the game and invite me to it so I can take a look further?
1781500541

Edited 1781500595
MidNiteShadow7
Pro
API Scripter
Version 2.1.4 is an update focused on reliability when HP is changed by other scripts, backwards compatibility for integrations, and cleanup of public exports. Change Log Fixed Fixed HealthColors not responding when HP is changed by an external script (e.g. AlterBars) that modifies the character attribute linked to a token bar rather than the token bar directly. Roll20 fires &nbsp; change:graphic &nbsp; too late in this path — &nbsp; prev.bar1_value &nbsp; already reflects the new value, so the early-return guard blocked every update. Added a dedicated &nbsp; change:attribute &nbsp; listener ( registerAttributeListener ) that fires reliably with genuine old/new values, verifies the token's bar is actually linked to the changed attribute, constructs a correct &nbsp; fakePrev , and calls &nbsp; handleToken &nbsp; with the real delta so aura/tint and dead-status update correctly. Fixed duplicate particle FX spawning when both the &nbsp; change:attribute &nbsp; and &nbsp; change:graphic &nbsp; listeners fire for the same HP change. The &nbsp; recentAttrFires &nbsp; Set tracks tokens recently handled by the attribute listener; the &nbsp; change:graphic &nbsp; wrapper ( handleTokenChange ) passes &nbsp; update='YES' &nbsp; for those tokens to suppress the redundant FX, and the marker is cleared after a 250 ms deduplication window. Fixed TokenMod's observer receiving the raw &nbsp; handleToken &nbsp; instead of &nbsp; handleTokenChange , causing TokenMod-triggered HP changes to bypass FX deduplication entirely. Fixed a race condition in &nbsp; applyAttrHpChange &nbsp; where two rapid HP changes within the 50 ms propagation window could cause the first timeout to overwrite the bar value already set by the second change. At timeout fire time the live bar value is now compared three ways: if it matches &nbsp; newVal &nbsp; Roll20 already propagated it (skip the set); if it matches neither &nbsp; oldVal &nbsp; nor &nbsp; newVal &nbsp; a concurrent change has landed (bail entirely); only if it still equals &nbsp; oldVal &nbsp; is the bar written. Fixed &nbsp; add:graphic &nbsp; handler: corrected from &nbsp; change:graphic &nbsp; to &nbsp; add:graphic &nbsp; in &nbsp; registerEventHandlers &nbsp; and added a null guard so the delayed token lookup safely handles tokens deleted before the 400 ms fires. Restored legacy public API aliases from v1.7.1 while keeping v2 camelCase exports. &nbsp; HealthColors &nbsp; now exposes both: &nbsp; gmWhisper / GMW , &nbsp; update / Update , &nbsp; checkInstall / CheckInstall , and &nbsp; registerEventHandlers / RegisterEventHandlers . Improved compatibility with AlterBars/PowerCards macro-driven HP updates that call &nbsp; HealthColors.Update(Target, Previous) &nbsp; using external token snapshots. Hardened previous-value handling for external updates by tolerating both object-style ( prev[bar + '_value'] ) and Roll20 getter-style ( prev.get(bar + '_value') ) lookups, and by safely proceeding with tint/aura, name visibility, and dead-marker updates when previous HP is missing or invalid. Updated FX/death-comparison gating so missing/invalid previous HP no longer aborts visual health updates; only delta-based FX/death transition comparisons are skipped when no reliable previous value is available. Changed Bootstrap/public export cleanup: introduced a single &nbsp; publicApi &nbsp; object for &nbsp; HealthColors , assigned it to &nbsp; globalThis.HealthColors , and returned it from the module IIFE so exported aliases and ready-time initialization stay in one canonical place. Extracted four input-normalization helpers ( normalizePercent , &nbsp; normalizePositiveNumber , &nbsp; normalizeYesNoOff , &nbsp; normalizeTrackName ) and applied them throughout &nbsp; handleInput , replacing ad-hoc inline validation with consistent, tested helpers. JSDoc corrections: &nbsp; applyDeadStatus.prevValue &nbsp; type widened to &nbsp; {number|string} ; &nbsp; toggleBtn &nbsp; and &nbsp; boolPill &nbsp; background-color descriptions corrected from green/red to blue/red (the true/false button background is &nbsp; #6FAEC7 , not green); &nbsp; registerEventHandlers &nbsp; bullet list updated to name &nbsp; handleTokenChange &nbsp; and &nbsp; add:graphic &nbsp; correctly. Where to install the mod from? Roll20 One-Click Installer coming soon. GitHub . Download and install manually via GitHub . You can learn more about the mod, explore the full feature set and access download links on the project page below: ➡️ &nbsp; Aura/Tint HealthColors Project Page As always, feedback and suggestions are welcome.
Hi i do not know if it is possible to manage this while interacting with the sheet (for me is the new 2024 dNd sheet). When the character goes to 0 it gets the big X on it BUT when is stabilized he is still at 0 but the X should disappear (or maybe another sign?) thanks Andrea
Are you referring to when players are at zero health, they are incapacitated until they run out of saves, then they are dead and should have the red cross?
MidNiteShadow7 said: Are you referring to when players are at zero health, they are incapacitated until they run out of saves, then they are dead and should have the red cross? yes and even if they are stabilized they stay at 0 health. but do not roll so the Red Cross is less appropriate for PC but I don't know if you can distinguish and also if it is not beyond the scope of the MOD. For those interested,&nbsp; I created 3 TokenMod scripts to manage this different status the first removes the cross and puts a skull and 2 counters, blue and red, to (manually) manage the saves !token-mod --set statusmarkers|-dead|blue:0|skull|red:0 the second allows to raise one after the player rolls !token-mod --set statusmarkers|?{Color|blue|red}:+1 the third declares a 0 but stable (still using the skull as I do not like the zzz of the unconscious...) !token-mod --set statusmarkers|-blue|green|-red I wonder if something similar can or wants to be managed by the script but even the cross for creatures and the skull for PC would be nice if possible
Hi Andrea, At the moment, HealthColors only knows about HP, so 0 HP is treated as the trigger for the dead marker. It cannot currently tell the difference between: at 0 HP and making death saves stable at 0 HP actually dead That distinction is not reliably represented by HP alone, and different sheets/mods handle death saves differently. But I do have an idea I need to test that could allow that option to be added. Give me some time with it, and I will see if my idea works. I've added this as an issue in GitHub:&nbsp; <a href="https://github.com/steverobertsuk/roll20-api-scripts/issues/20" rel="nofollow">https://github.com/steverobertsuk/roll20-api-scripts/issues/20</a> I'll update you soon.
Version 2.1.4 is now in the One-Click installer. MidNiteShadow7 said: Version 2.1.4 is an update focused on reliability when HP is changed by other scripts, backwards compatibility for integrations, and cleanup of public exports. Change Log Fixed Fixed HealthColors not responding when HP is changed by an external script (e.g. AlterBars) that modifies the character attribute linked to a token bar rather than the token bar directly. Roll20 fires &nbsp; change:graphic &nbsp; too late in this path — &nbsp; prev.bar1_value &nbsp; already reflects the new value, so the early-return guard blocked every update. Added a dedicated &nbsp; change:attribute &nbsp; listener ( registerAttributeListener ) that fires reliably with genuine old/new values, verifies the token's bar is actually linked to the changed attribute, constructs a correct &nbsp; fakePrev , and calls &nbsp; handleToken &nbsp; with the real delta so aura/tint and dead-status update correctly. Fixed duplicate particle FX spawning when both the &nbsp; change:attribute &nbsp; and &nbsp; change:graphic &nbsp; listeners fire for the same HP change. The &nbsp; recentAttrFires &nbsp; Set tracks tokens recently handled by the attribute listener; the &nbsp; change:graphic &nbsp; wrapper ( handleTokenChange ) passes &nbsp; update='YES' &nbsp; for those tokens to suppress the redundant FX, and the marker is cleared after a 250 ms deduplication window. Fixed TokenMod's observer receiving the raw &nbsp; handleToken &nbsp; instead of &nbsp; handleTokenChange , causing TokenMod-triggered HP changes to bypass FX deduplication entirely. Fixed a race condition in &nbsp; applyAttrHpChange &nbsp; where two rapid HP changes within the 50 ms propagation window could cause the first timeout to overwrite the bar value already set by the second change. At timeout fire time the live bar value is now compared three ways: if it matches &nbsp; newVal &nbsp; Roll20 already propagated it (skip the set); if it matches neither &nbsp; oldVal &nbsp; nor &nbsp; newVal &nbsp; a concurrent change has landed (bail entirely); only if it still equals &nbsp; oldVal &nbsp; is the bar written. Fixed &nbsp; add:graphic &nbsp; handler: corrected from &nbsp; change:graphic &nbsp; to &nbsp; add:graphic &nbsp; in &nbsp; registerEventHandlers &nbsp; and added a null guard so the delayed token lookup safely handles tokens deleted before the 400 ms fires. Restored legacy public API aliases from v1.7.1 while keeping v2 camelCase exports. &nbsp; HealthColors &nbsp; now exposes both: &nbsp; gmWhisper / GMW , &nbsp; update / Update , &nbsp; checkInstall / CheckInstall , and &nbsp; registerEventHandlers / RegisterEventHandlers . Improved compatibility with AlterBars/PowerCards macro-driven HP updates that call &nbsp; HealthColors.Update(Target, Previous) &nbsp; using external token snapshots. Hardened previous-value handling for external updates by tolerating both object-style ( prev[bar + '_value'] ) and Roll20 getter-style ( prev.get(bar + '_value') ) lookups, and by safely proceeding with tint/aura, name visibility, and dead-marker updates when previous HP is missing or invalid. Updated FX/death-comparison gating so missing/invalid previous HP no longer aborts visual health updates; only delta-based FX/death transition comparisons are skipped when no reliable previous value is available. Changed Bootstrap/public export cleanup: introduced a single &nbsp; publicApi &nbsp; object for &nbsp; HealthColors , assigned it to &nbsp; globalThis.HealthColors , and returned it from the module IIFE so exported aliases and ready-time initialization stay in one canonical place. Extracted four input-normalization helpers ( normalizePercent , &nbsp; normalizePositiveNumber , &nbsp; normalizeYesNoOff , &nbsp; normalizeTrackName ) and applied them throughout &nbsp; handleInput , replacing ad-hoc inline validation with consistent, tested helpers. JSDoc corrections: &nbsp; applyDeadStatus.prevValue &nbsp; type widened to &nbsp; {number|string} ; &nbsp; toggleBtn &nbsp; and &nbsp; boolPill &nbsp; background-color descriptions corrected from green/red to blue/red (the true/false button background is &nbsp; #6FAEC7 , not green); &nbsp; registerEventHandlers &nbsp; bullet list updated to name &nbsp; handleTokenChange &nbsp; and &nbsp; add:graphic &nbsp; correctly. Where to install the mod from? Roll20 One-Click Installer coming soon. GitHub . Download and install manually via GitHub . You can learn more about the mod, explore the full feature set and access download links on the project page below: ➡️ &nbsp; Aura/Tint HealthColors Project Page As always, feedback and suggestions are welcome.
Hi! I'm on 2.1.4 but unfortunately I'm still experiencing the issue where Alterbars doesn't trigger Healthcolors. Loving this script, thanks for your work :)
Dungeonmaster Matt said: Hi! I'm on 2.1.4 but unfortunately I'm still experiencing the issue where Alterbars doesn't trigger Healthcolors. Loving this script, thanks for your work :) Hi, can you tell me which game system you are using? Can you also let me know if you are using the Default or Experimental API sandbox? Do you also want to try restarting the API sandbox, then use the following command in the chat?: !aura forceall
D&amp;D 5e 2014, default sandbox. Alterbars 2.0.5. !aura forceall seemed to work! Thank you very much.
Dungeonmaster Matt said: D&amp;D 5e 2014, default sandbox. Alterbars 2.0.5. !aura forceall seemed to work! Thank you very much. If the `forceall` command worked, it likely needed a refresh after the update. But let me know if you encounter any further issues.
hi, I saw the 2.0.0 and immediately tried the death management so bringing to 0 puts the skull but adding or rolling success or failures does not seem to do anything (the setting on health color seem to imply something should happen) and the 3 failures do not trigger the red cross (if it was supposed to)
Hi Andrea, do you want to create a copy of your game and send me an invite link in a private message? I can then take a look for you.
1782957795

Edited 1782957878
Andrea L. said: hi, I saw the 2.0.0 and immediately tried the death management so bringing to 0 puts the skull but adding or rolling success or failures does not seem to do anything (the setting on health color seem to imply something should happen) and the 3 failures do not trigger the red cross (if it was supposed to) Same but I suspect this it more sheet related than it is the API. Since the sheet doesn't seem to know your dead and there isn't a button for it. Also clicking stable on the 2024 sheet also does nothing
With version 2.2.0, there is a command to debug - do you want to try it?: `!aura deathsaves debug`
I mean I got this but it didn't fix anything
Master Azroth said: I mean I got this but it didn't fix anything If you reduce the HP to zero, the checks against the deathsaves should then begin to work.
1782987221

Edited 1782989419
i set it to 0 and got the skull then rolled 1 die but got nothing here the message i sent you a private invite to the game
MidNiteShadow7 said: Master Azroth said: I mean I got this but it didn't fix anything If you reduce the HP to zero, the checks against the deathsaves should then begin to work. Oh yes going to 0 works for both PC's and NPC's just fine. It's the stabilize and death that doesn't work for PC's, at least not on the 2024 sheet I have no idea about the 2014 sheet.&nbsp;
Azroth, do you want to try using this 2.2.1 beta version?: <a href="https://www.dropbox.com/scl/fi/7kz4sj7hwlm8ej746uszv/HealthColors_v2.2.1.beta.1.zip?rlkey=siwqxdkdi0hgccnbkfz0v224j&amp;dl=0" rel="nofollow">https://www.dropbox.com/scl/fi/7kz4sj7hwlm8ej746uszv/HealthColors_v2.2.1.beta.1.zip?rlkey=siwqxdkdi0hgccnbkfz0v224j&amp;dl=0</a> It has some 2024 fixes that should resolve your issues.
MidNiteShadow7 said: Azroth, do you want to try using this 2.2.1 beta version?: <a href="https://www.dropbox.com/scl/fi/7kz4sj7hwlm8ej746uszv/HealthColors_v2.2.1.beta.1.zip?rlkey=siwqxdkdi0hgccnbkfz0v224j&amp;dl=0" rel="nofollow">https://www.dropbox.com/scl/fi/7kz4sj7hwlm8ej746uszv/HealthColors_v2.2.1.beta.1.zip?rlkey=siwqxdkdi0hgccnbkfz0v224j&amp;dl=0</a> It has some 2024 fixes that should resolve your issues. No change, as far as the problem I'm dealing with it's acting exactly the same. The only thing I saw was that when that api is active my sandbox is constantly updating
Master Azroth said: No change, as far as the problem I'm dealing with it's acting exactly the same. The only thing I saw was that when that api is active my sandbox is constantly updating If you can create a copy of the game and send me an invite via a PM, I can take a look.
1783475656

Edited 1783475711
MidNiteShadow7
Pro
API Scripter
HealthColors v2.2.1 is now available in the One-Click Installer. Version 2.2.1 improves the reliability of Death Save Integration, especially for the D&amp;D 2024/Beacon character sheet. It adds a manual sync command, improves automatic marker updates, provides clearer compatibility warnings and debugging, and fixes several issues that could prevent death-save markers from updating correctly. Change Log Added Added !aura deathsaves sync to force an immediate death-save marker reconciliation for selected PCs after imports, sheet changes, or missed updates. Added a one-time GM warning when a watched PC’s death saves are not stored as legacy attributes. This calls out the Experimental (Jumpgate) sandbox requirement for live Beacon/D&amp;D 2024 death-save reads and explains the failure mode on the Default sandbox. Expanded !aura deathsaves debug so it now reports resolved watched-field values, sheet-item API availability, the selected character’s legacy-attribute count, how many watched fields are stored as legacy attributes, and a Beacon/sandbox compatibility warning when none are. Documented the Experimental (Jumpgate) sandbox requirement for Beacon/D&amp;D 2024 death-save syncing in the README, including the known silently-reverting Roll20 dropdown issue. Changed Refined the Death Save Integration introduced in 2.2.0 so watch, sync, and debug flows now use alias-aware field resolution ( succ / success , fail / failure ) before evaluating marker state, improving compatibility across sheet variants without changing the GM-facing configuration model. Added a lightweight 3-second polling pass for downed PCs so death-save markers stay current even on sheets that do not emit usable legacy change:attribute events. Updated the fallback resolver to prefer Jumpgate getSheetItem reads for non-legacy death-save fields, while retaining the chat-parser probe only as a legacy-sandbox fallback. Fixed Fixed D&amp;D 2024 / Beacon death-save syncing when equivalent sheet field names differ from the configured defaults by resolving configured watches through alias-aware lookups and probing only the still-unresolved aliases. Fixed repeated Roll20 parser errors from fallback death-save probes by removing character-id references ( @{&lt;id&gt;|attr} ) and using safe character-name probes instead. Fixed repeated startup and sync errors caused by asking Roll20 for death-save field names the current game sheet does not define. The resolver now keeps a persisted game-wide field-name status cache ( state.HealthColors.dsFieldStatus ) so proven-good names are reused, rejected names are not retried, and the cache is cleared automatically when the GM reconfigures death-save fields or manually resyncs after a sheet change. Where to install the mod from? Roll20 One-Click Installer. Roll20 API GitHub master branch . GitHub Download ZIP and install manually via GitHub . You can learn more about the mod, explore the full feature set and access download links on the project page below: ➡️ Aura/Tint HealthColors Project Page