Skip to content
3 Death Saves
Wiki updated as of 1.5.1 (Sep 2026)

API Reference

The API attaches during the ready hook. Both paths point to the same object.

const api = game.modules.get('tenacity').api;
// or
globalThis.TENACITY;

Returns the value of a Tenacity world setting. Pass the setting key as a string.

const cap = api.getSetting('maxTenacity');

The class that owns the per-actor mote pool. Most methods below wrap its static methods.

A map of the hook names listed under Hooks.

Hooks.on(api.HOOKS.MOTE_SPENT, ({ actorUuid, amount }) => {});

Adds motes to an actor’s pool, capped at the actor’s effective maximum. The effective maximum is the per-actor override when one is set, otherwise the maxTenacity setting.

  • amount (number): motes to add. Default 1.
  • sourceMessageId (string|null): chat message id the mote is tied to. Self-rescue tracking uses it. Default null.
  • reason (string): tag stored on the mote record. Default 'manual'.

Returns: Promise<number>, the number of motes added after the cap.

const added = await api.grant(actor, { amount: 2, reason: 'milestone' });

Removes motes from an actor’s pool.

  • amount (integer): motes to consume. Must be a positive integer.
  • excludeSourceMessageId (string, optional): motes earned from this message id are not spendable.
  • reason (string, optional): tag passed to tenacity.moteSpent. Default 'spend'.

Returns: Promise<Array|null>, the consumed mote records, or null if the spend was rejected.

const consumed = await api.spend(actor, { amount: 1 });
if (consumed) await api.refund(actor, consumed);

Returns records from an earlier spend to the actor’s pool, capped at the effective maximum.

Returns: Promise<number>, the number of motes restored after the cap.

Empties the actor’s pool. options.reason is passed to tenacity.poolReset. Default 'manual'.

Returns: Promise<void>.

MethodReturns
count(actor)Total motes in the pool.
spendableCount(actor, excludeSourceMessageId?)Motes the actor can spend, excluding motes earned from the given message, if any.
getMotes(actor)A deep clone of the mote records: Array<{ id, sourceMessageId, earnedAt, reason }>.

Clears the pool of every world actor and posts a notification with the number of pools cleared. GM-only; a non-GM call does nothing.

Returns: Promise<void>.

HookPayloadFires
tenacity.moteGranted{ actorUuid, amount, reason }When a grant or refund adds motes. Refunds use reason refund.
tenacity.moteSpent{ actorUuid, amount, reason, consumed }On a spend. consumed is the array of removed records.
tenacity.poolReset{ actorUuid, cleared, reason }On a clear. cleared is the pool size before the reset.
tenacity.rollBumped{ actorUuid, messageId, amount, reason }After a bumped roll’s chat message updates. Monk’s TokenBar row bumps add tokenId; Flash Rolls row bumps add uniqueId.
tenacity.rollRerolled{ actorUuid, messageId, originalTotal, consumed }After a rerolled roll’s chat message updates.
FlagTypeEffect
flags.tenacity.maxOverrideintegerPer-actor maximum that replaces the maxTenacity setting for that actor.
flags.hero-mancer.grantsMotesbooleanWhen true on a new character, Tenacity skips its starting grant. Hero Mancer sets it.