Log in

View Full Version : attunement listener?



jkeller
November 5th, 2025, 15:36
In 5E, is there a way to know when attunement status changes?

I tried reassigning this:
CharAttunementManager.onCharItemAttuneUpdate = myOnCharItemAttuneUpdate;

And adding my own handler:
DB.addHandler("charsheet.*.inventorylist.*.attune", "onUpdate", myOnCharItemAttuneUpdate);

But they don't seem to be called when I click on the Attunement toggle on the Character Sheet.

Thanks!

Trenloe
November 5th, 2025, 15:58
The standard onCharItemAttuneUpdate works fine for me. I added some debug code to verify:


function onCharItemAttuneUpdate(nodeAttuneUse)
Debug.console("onCharItemAttuneUpdate - nodeAttuneUse = ", nodeAttuneUse);
local nodeChar = DB.getChild(nodeAttuneUse, "....");
CharAttunementManager.onAttuneCalcChange(nodeChar) ;
end

Using similar debug code - verify your DB.addHandler code is being called first to setup the handler and then also used debug code to see if the handler is being called.