Pathfinder 1e for Foundry VTT
    Preparing search index...

    Interface StaticCallbacks

    interface StaticCallbacks {
        pf1ActorRest: (
            actor: ActorPF,
            restOptions: ActorRestOptions,
            updateData: Record<string, unknown>,
            itemUpdates: Record<string, unknown>[],
        ) => void;
        pf1ActorRollAbility: (actor: ActorPF, result: any, ability: string) => void;
        pf1ActorRollBab: (actor: ActorPF, result: any) => void;
        pf1ActorRollCl: (actor: ActorPF, result: any, spellbook: string) => void;
        pf1ActorRollConcentration: (
            actor: ActorPF,
            result: any,
            spellbook: string,
        ) => void;
        pf1ActorRollSave: (
            actor: ActorPF,
            result: any,
            save: "fort" | "ref" | "will",
        ) => void;
        pf1ActorRollSkill: (actor: ActorPF, result: any, skill: string) => void;
        pf1AddDefaultChanges: (actor: ActorPF, changes: Change[]) => void;
        pf1ApplyDamage: (actor: ActorPF, options: ApplyDamageOptions) => void;
        pf1ApplyDamageTargetOptions: (
            app: ApplyDamage,
            target: object,
            options: ApplyDamageOptions,
        ) => void;
        pf1AttackRoll: (action: Action, roll: D20RollPF, context: object) => void;
        pf1ClassLevelChange: (
            actor: ActorPF,
            classItem: ItemPF<ClassModel>,
            currentLevel: number,
            newLevel: number,
        ) => void;
        pf1CombatTurnSkip: (
            combat: CombatPF,
            skipped: Set<CombatantPF>,
            context: Record<string, unknown>,
        ) => void;
        pf1CreateActionUse: (actionUse: ActionUse) => void;
        pf1CreateItemLink: (
            item: ItemPF,
            link: ItemLink,
            kind: "children" | "charges" | "classAssociations" | "ammunition",
        ) => void;
        pf1DeleteItemLink: (
            item: ItemPF,
            link: ItemLink,
            kind: "children" | "charges" | "classAssociations" | "ammunition",
        ) => void;
        pf1DisplayCard: (
            item: ItemPF,
            data: {
                msgData: Record<string, unknown>;
                template: string;
                templateData: Record<string, unknown>;
            },
        ) => boolean;
        pf1DropContainerSheetData: (
            item: ItemPF<ContainerModel>,
            sheet: ContainerSheetPF,
            data: Record<string, unknown>,
        ) => boolean;
        pf1GainXp: (actor: ActorPF, xp: { value: number }) => void;
        pf1GetChangeFlat: (
            result: string[],
            target:
                | "attack"
                | "size"
                | "skills"
                | "skill"
                | "damage"
                | "acpA"
                | "acpS"
                | "mDexA"
                | "mDexS"
                | "str"
                | "dex"
                | "con"
                | "int"
                | "wis"
                | "cha"
                | "strMod"
                | "dexMod"
                | "conMod"
                | "intMod"
                | "wisMod"
                | "chaMod"
                | "strPen"
                | "dexPen"
                | "conPen"
                | "intPen"
                | "wisPen"
                | "chaPen"
                | "~strDrain"
                | "~dexDrain"
                | "~conDrain"
                | "~intDrain"
                | "~wisDrain"
                | "~chaDrain"
                | "carryStr"
                | "carryMult"
                | "reach"
                | "ageCategory"
                | "ageCategoryPhysical"
                | "ageCategoryMental"
                | "unskills"
                | "strSkills"
                | "dexSkills"
                | "conSkills"
                | "intSkills"
                | "wisSkills"
                | "chaSkills"
                | "skill.knowledge"
                | "allChecks"
                | "strChecks"
                | "dexChecks"
                | "conChecks"
                | "intChecks"
                | "wisChecks"
                | "chaChecks"
                | "landSpeed"
                | "climbSpeed"
                | "swimSpeed"
                | "burrowSpeed"
                | "flySpeed"
                | "allSpeeds"
                | "ac"
                | "aac"
                | "sac"
                | "nac"
                | "tac"
                | "ffac"
                | "bab"
                | "~attackCore"
                | "wattack"
                | "sattack"
                | "mattack"
                | "nattack"
                | "rattack"
                | "tattack"
                | "wdamage"
                | "mwdamage"
                | "rwdamage"
                | "twdamage"
                | "rdamage"
                | "mdamage"
                | "ndamage"
                | "sdamage"
                | "critConfirm"
                | "allSavingThrows"
                | "fort"
                | "ref"
                | "will"
                | "vehicleSave"
                | "cmb"
                | "cmd"
                | "ffcmd"
                | "init"
                | "mhp"
                | "wounds"
                | "vigor"
                | "woundThreshold"
                | "spellResist"
                | "bonusFeats"
                | "bonusSkillRanks"
                | "concentration"
                | "cl"
                | "concn"
                | "dc"
                | "asf"
                | "senselv"
                | "sensedv"
                | "sensets"
                | "sensebse"
                | "sensebs"
                | "sensels"
                | "sensesc"
                | "sensetr"
                | "senseths"
                | string & {},
            modifierType:
                | "haste"
                | "base"
                | "untyped"
                | "untypedPerm"
                | "enh"
                | "dodge"
                | "inherent"
                | "deflection"
                | "morale"
                | "luck"
                | "sacred"
                | "insight"
                | "resist"
                | "profane"
                | "trait"
                | "racial"
                | "size"
                | "competence"
                | "circumstance"
                | "alchemical"
                | string & {}
                | undefined,
            value: number | undefined,
            actor: ActorPF,
        ) => void;
        pf1GetRollData: (
            document: ActorPF<BaseActorModel> | Action | ItemPF<BaseItemModel>,
            data: Record<string, unknown>,
        ) => void;
        pf1HealthDeltaRender: (
            actor: ActorPF,
            options: object,
            textOptions: object,
        ) => void;
        pf1MigrationFinished: () => void;
        pf1MigrationStarted: () => void;
        pf1PartyRest: (config: object) => void;
        pf1PostActionUse: (actionUse: ActionUse, chatMessage: any) => void;
        pf1PostInit: () => void;
        pf1PostReady: () => void;
        pf1PostSetup: () => void;
        pf1PreActionUse: (actionUse: ActionUse) => boolean;
        pf1PreActorRest: (
            actor: ActorPF,
            restOptions: ActorRestOptions,
            updateData: Record<string, unknown>,
            itemUpdates: Record<string, unknown>[],
        ) => boolean;
        pf1PreActorRollAbility: (
            actor: ActorPF,
            options: D20ActorRollOptions,
            ability: string,
        ) => boolean;
        pf1PreActorRollBab: (
            actor: ActorPF,
            options: D20ActorRollOptions,
        ) => boolean;
        pf1PreActorRollCl: (
            actor: ActorPF,
            options: D20ActorRollOptions,
            spellbook: string,
        ) => boolean;
        pf1PreActorRollConcentration: (
            actor: ActorPF,
            options: D20ActorRollOptions,
            spellbook: string,
        ) => boolean;
        pf1PreActorRollSave: (
            actor: ActorPF,
            options: D20ActorRollOptions,
            save: "fort" | "ref" | "will",
        ) => boolean;
        pf1PreActorRollSkill: (
            actor: ActorPF,
            options: D20ActorRollOptions,
            skill: string,
        ) => boolean;
        pf1PreAttackRoll: (
            action: Action,
            config: object,
            rollData: object,
            rollOptions: object,
            parts: string[],
            changes: Change[],
        ) => void;
        pf1PreD20Roll: (
            roll: D20RollPF,
            options: Partial<D20ActorRollOptions>,
        ) => boolean;
        pf1PreDamageRoll: (
            action: Action,
            rollData: object,
            parts: DamagePart[],
            changes: Change[],
        ) => void;
        pf1PreDisplayActionUse: (actionUse: ActionUse) => boolean;
        pf1PrepareBaseActorData: (actor: ActorPF) => void;
        pf1PrepareDerivedActorData: (actor: ActorPF) => void;
        pf1PrePartyRest: (config: object) => void;
        pf1RenderQuickActions: (
            hud: TokenHUD,
            token: Token,
            template: DocumentFragment,
        ) => void;
        pf1ToggleActorBuff: (
            actor: ActorPF,
            item: ItemPF<BuffModel>,
            state: boolean,
        ) => void;
        pf1ToggleActorCondition: (
            actor: ActorPF,
            condition:
                | "polymorph"
                | "fear"
                | "confuse"
                | "daze"
                | "dazzle"
                | "fatigue"
                | "paralyze"
                | "petrify"
                | "stun"
                | "poison"
                | "bleed"
                | "blind"
                | "deaf"
                | "exhausted"
                | "sleep"
                | "curse"
                | "disease"
                | "mindAffecting"
                | "deathEffects"
                | "energyDrain"
                | "moraleEffects"
                | "sicken"
                | string & {},
            state: boolean,
        ) => void;
        renderPF1ExtendedTooltip: (
            sheet: ActorSheet,
            id: string,
            template: DocumentFragment,
        ) => void;
    }
    Index

    Properties

    pf1ApplyDamage: (actor: ActorPF, options: ApplyDamageOptions) => void

    Pre-apply damage

    A hook fired just before apply damage starts processing the provided information.

    • The damage value is passed as part of the options (which preferably remains unmodified by handlers)
    pf1ApplyDamageTargetOptions: (
        app: ApplyDamage,
        target: object,
        options: ApplyDamageOptions,
    ) => void

    Per-target options from apply damage dialog to be passed to ActorPF#applyDamage fucntion.

    Called just before the apply damage dialog passes

    • Only actor part of the target object is guaranteed to be there.
    pf1AttackRoll: (action: Action, roll: D20RollPF, context: object) => void

    Post attack roll hook fired after evaluating attack roll.

    Type Declaration

      • (action: Action, roll: D20RollPF, context: object): void
      • Parameters

        • action: Action

          Action that triggered the attack roll

        • roll: D20RollPF

          The attack roll

        • context: object

        Returns void

    pf1HealthDeltaRender: (
        actor: ActorPF,
        options: object,
        textOptions: object,
    ) => void

    Health Delta render hook

    Allows altering scrolling text rendered for health changes.

    Type Declaration

      • (actor: ActorPF, options: object, textOptions: object): void
      • Parameters

        • actor: ActorPF

          Actor

        • options: object

          Options, not all options are valid for modifiation

        • textOptions: object

          Options as passed to createScrollingText(..., ..., options)

        Returns void

    • Return false to prevent the message from being rendered.

    PF1 v11

    pf1PreAttackRoll: (
        action: Action,
        config: object,
        rollData: object,
        rollOptions: object,
        parts: string[],
        changes: Change[],
    ) => void

    Pre-attack roll hook fired before rolling an attack.

    Type Declaration

      • (
            action: Action,
            config: object,
            rollData: object,
            rollOptions: object,
            parts: string[],
            changes: Change[],
        ): void
      • Parameters

        • action: Action

          Action triggering the attack roll

        • config: object

          Attack configuration

        • rollData: object

          Roll data

        • rollOptions: object

          Options to be passed to D20RollPF

        • parts: string[]

          Individual Roll parts added to formula

        • changes: Change[]

          The Changes applicable to this attack before they're reduced to the highest bonus of each type

        Returns void

    pf1PreDamageRoll: (
        action: Action,
        rollData: object,
        parts: DamagePart[],
        changes: Change[],
    ) => void

    Pre-attack roll hook fired before rolling an attack.

    Type Declaration

      • (action: Action, rollData: object, parts: DamagePart[], changes: Change[]): void
      • Parameters

        • action: Action

          Action triggering the attack roll

        • rollData: object

          Roll data

        • parts: DamagePart[]

          Individual DamageParts added to formula (only the first's extra is used)

        • changes: Change[]

          The Changes applicable to this attack before they're reduced to the highest bonus of each type

        Returns void

    pf1RenderQuickActions: (
        hud: TokenHUD,
        token: Token,
        template: DocumentFragment,
    ) => void

    Token HUD quick action render.

    Type Declaration

      • (hud: TokenHUD, token: Token, template: DocumentFragment): void
      • Parameters

        • hud: TokenHUD

          Token HUD

        • token: Token

          Token placeable

        • template: DocumentFragment

          HTML document fragment before being added to DOM.

        Returns void

    PF1 v11

    Actions

    pf1CreateActionUse: (actionUse: ActionUse) => void

    A hook event fired by the system when an action is to be used. This hook fires before any updates are applied to the actor/item, like ammo or spell slots, and before any attacks are rolled.

    Type Declaration

      • (actionUse: ActionUse): void
      • Parameters

        • actionUse: ActionUse

          The ActionUse instance containing all data relevant to the action use.

        Returns void

    Called by Hooks.callAll

    pf1PostActionUse: (actionUse: ActionUse, chatMessage: any) => void

    A hook event fired by the system when an action has been successfully used. This hook fires after the action has been used and after any chat .

    Type Declaration

      • (actionUse: ActionUse, chatMessage: any): void
      • Parameters

        • actionUse: ActionUse

          The ActionUse instance containing all data relevant to the action use.

        • chatMessage: any

          The ChatMessage | null created by using the action, or null if no message was created.

        Returns void

    Called by Hooks.callAll

    pf1PreActionUse: (actionUse: ActionUse) => boolean

    A hook event fired by the system when an action is to be used. This hook fires before any updates are applied to the actor/item, like ammo or spell slots and includes all of the action's rolled attacks.

    Type Declaration

      • (actionUse: ActionUse): boolean
      • Parameters

        • actionUse: ActionUse

          The ActionUse instance containing all data relevant to the action use.

        Returns boolean

        Explicitly return false to prevent the action from being used.

    Called by Hooks.call

    pf1PreDisplayActionUse: (actionUse: ActionUse) => boolean

    A hook event fired by the system when an action is used, before the chat message is created.

    Type Declaration

      • (actionUse: ActionUse): boolean
      • Parameters

        • actionUse: ActionUse

          The ActionUse instance containing all data relevant to the action use.

        Returns boolean

        Explicitly return false to prevent the action's usage chat card being displayed.

    Called by Hooks.call

    Actor

    pf1ActorRest: (
        actor: ActorPF,
        restOptions: ActorRestOptions,
        updateData: Record<string, unknown>,
        itemUpdates: Record<string, unknown>[],
    ) => void

    A hook event fired by the system after an actor has rested.

    Type Declaration

      • (
            actor: ActorPF,
            restOptions: ActorRestOptions,
            updateData: Record<string, unknown>,
            itemUpdates: Record<string, unknown>[],
        ): void
      • Parameters

        • actor: ActorPF

          The actor who has rested.

        • restOptions: ActorRestOptions

          The options passed to the method's call. Mutating this data will not affect the system's calculations, as they are finished when this hook is fired. This data can be used to base different rest calculations on, however.

        • updateData: Record<string, unknown>

          The data the resting actor was updated with.

        • itemUpdates: Record<string, unknown>[]

          An array of item updates applied to the resting actor.

        Returns void

    Called by Hooks.callAll

    pf1GainXp: (actor: ActorPF, xp: { value: number }) => void

    A hook event fired by the system when an ActorPF gains XP.

    Type Declaration

      • (actor: ActorPF, xp: { value: number }): void
      • Parameters

        • actor: ActorPF

          The actor who gained XP.

        • xp: { value: number }

          An object containing a number that can be adjusted in callbacks.

          • value: number

            The amount of XP gained.

        Returns void

    Called by Hooks.callAll

    pf1PreActorRest: (
        actor: ActorPF,
        restOptions: ActorRestOptions,
        updateData: Record<string, unknown>,
        itemUpdates: Record<string, unknown>[],
    ) => boolean

    A hook event fired by the system when an actor's ActorPF.performRest is called.

    Type Declaration

      • (
            actor: ActorPF,
            restOptions: ActorRestOptions,
            updateData: Record<string, unknown>,
            itemUpdates: Record<string, unknown>[],
        ): boolean
      • Parameters

        • actor: ActorPF

          The actor who is resting.

        • restOptions: ActorRestOptions

          The options passed to the method's call. Mutating this data will not affect the system's calculations, as they are finished when this hook is fired. This data can be used to base different rest calculations on, however.

        • updateData: Record<string, unknown>

          The data the resting actor will be updated with. This data object can be mutated to affect the update (e.g. the number of hit points).

        • itemUpdates: Record<string, unknown>[]

          An array of item updates to be applied to the resting actor. This array can be mutated to affect the update (e.g. which item's uses are restored).

        Returns boolean

        Explicitly return false to prevent the actor from resting.

    Called by Hooks.call

    pf1PrepareBaseActorData: (actor: ActorPF) => void

    A hook event fired by the system when an ActorPF's base data is prepared. This happens whenever an actor is updated, and the preparation process is expected to be synchronous. Data added or mutated asynchronously might not be factored in at all.

    Type Declaration

      • (actor: ActorPF): void
      • Parameters

        • actor: ActorPF

          The actor whose data is prepared.

        Returns void

    Called by Hooks.callAll

    pf1PrepareDerivedActorData: (actor: ActorPF) => void

    A hook event fired by the system when an ActorPF's derived data is prepared. This happens whenever an actor is updated, and the preparation process is expected to be synchronous. Data added or mutated asynchronously might not be factored in at all.

    Type Declaration

      • (actor: ActorPF): void
      • Parameters

        • actor: ActorPF

          The actor whose data is prepared.

        Returns void

    Called by Hooks.callAll

    pf1ToggleActorBuff: (
        actor: ActorPF,
        item: ItemPF<BuffModel>,
        state: boolean,
    ) => void

    A hook event fired by the system when pf1.models.item.BuffModel#active has changed in an item embedded in an actor has changed.

    This is also fired when a buff with its active state already set to true is added to an actor.

    Type Declaration

      • (actor: ActorPF, item: ItemPF<BuffModel>, state: boolean): void
      • Parameters

        • actor: ActorPF

          The actor whose buff's active state has changed.

        • item: ItemPF<BuffModel>

          The buff whose active state has changed.

        • state: boolean

          The new state of the buff.

        Returns void

    Called by Hooks.callAll

    pf1ToggleActorCondition: (
        actor: ActorPF,
        condition:
            | "polymorph"
            | "fear"
            | "confuse"
            | "daze"
            | "dazzle"
            | "fatigue"
            | "paralyze"
            | "petrify"
            | "stun"
            | "poison"
            | "bleed"
            | "blind"
            | "deaf"
            | "exhausted"
            | "sleep"
            | "curse"
            | "disease"
            | "mindAffecting"
            | "deathEffects"
            | "energyDrain"
            | "moraleEffects"
            | "sicken"
            | string & {},
        state: boolean,
    ) => void

    A hook event fired by the system when one or more of an actor's conditions have changed. The conditions object can be found in actor.system.conditions.

    Type Declaration

      • (
            actor: ActorPF,
            condition:
                | "polymorph"
                | "fear"
                | "confuse"
                | "daze"
                | "dazzle"
                | "fatigue"
                | "paralyze"
                | "petrify"
                | "stun"
                | "poison"
                | "bleed"
                | "blind"
                | "deaf"
                | "exhausted"
                | "sleep"
                | "curse"
                | "disease"
                | "mindAffecting"
                | "deathEffects"
                | "energyDrain"
                | "moraleEffects"
                | "sicken"
                | string & {},
            state: boolean,
        ): void
      • Parameters

        • actor: ActorPF

          The actor whose conditions have changed.

        • condition:
              | "polymorph"
              | "fear"
              | "confuse"
              | "daze"
              | "dazzle"
              | "fatigue"
              | "paralyze"
              | "petrify"
              | "stun"
              | "poison"
              | "bleed"
              | "blind"
              | "deaf"
              | "exhausted"
              | "sleep"
              | "curse"
              | "disease"
              | "mindAffecting"
              | "deathEffects"
              | "energyDrain"
              | "moraleEffects"
              | "sicken"
              | string & {}

          The name of the condition that has changed as per CONFIG.PF1.conditionTypes.

        • state: boolean

          The new state of the condition.

        Returns void

    Called by Hooks.callAll

    Actor Rolls

    pf1ActorRollAbility: (actor: ActorPF, result: any, ability: string) => void

    A hook event fired by the system after an ActorPF rolled an ability check.

    Type Declaration

      • (actor: ActorPF, result: any, ability: string): void
      • Parameters

        • actor: ActorPF

          The actor who rolled an ability check

        • result: any

          The roll result, either as ChatMessage if one was created, or as object containing data that would have been used to create one.

        • ability: string

          The key of the ability that was rolled

        Returns void

    Called by Hooks.callAll

    pf1ActorRollBab: (actor: ActorPF, result: any) => void

    A hook event fired by the system after an ActorPF rolled their BAB.

    Type Declaration

      • (actor: ActorPF, result: any): void
      • Parameters

        • actor: ActorPF

          The actor who rolled their BAB

        • result: any

          The roll result, either as ChatMessage if one was created, or as object containing data that would have been used to create one.

        Returns void

    Called by Hooks.callAll

    pf1ActorRollCl: (actor: ActorPF, result: any, spellbook: string) => void

    A hook event fired by the system after an ActorPF rolled a caster level check.

    Type Declaration

      • (actor: ActorPF, result: any, spellbook: string): void
      • Parameters

        • actor: ActorPF

          The actor who rolled a caster level check

        • result: any

          The roll result, either as ChatMessage if one was created, or as object containing data that would have been used to create one.

        • spellbook: string

          The key of the spellbook whose caster level was rolled

        Returns void

    Called by Hooks.callAll

    pf1ActorRollConcentration: (
        actor: ActorPF,
        result: any,
        spellbook: string,
    ) => void

    A hook event fired by the system after an ActorPF rolled a concentration check.

    Type Declaration

      • (actor: ActorPF, result: any, spellbook: string): void
      • Parameters

        • actor: ActorPF

          The actor who rolled a concentration check

        • result: any

          The roll result, either as ChatMessage if one was created, or as object containing data that would have been used to create one.

        • spellbook: string

          The key of the spellbook whose concentration was rolled

        Returns void

    Called by Hooks.callAll

    pf1ActorRollSave: (
        actor: ActorPF,
        result: any,
        save: "fort" | "ref" | "will",
    ) => void

    A hook event fired by the system after an ActorPF rolled a save.

    Type Declaration

      • (actor: ActorPF, result: any, save: "fort" | "ref" | "will"): void
      • Parameters

        • actor: ActorPF

          The actor who rolled a save

        • result: any

          The roll result, either as ChatMessage if one was created, or as object containing data that would have been used to create one.

        • save: "fort" | "ref" | "will"

          The key of the save that was rolled

        Returns void

    Called by Hooks.callAll

    pf1ActorRollSkill: (actor: ActorPF, result: any, skill: string) => void

    A hook event fired by the system after an ActorPF rolled a skill.

    Type Declaration

      • (actor: ActorPF, result: any, skill: string): void
      • Parameters

        • actor: ActorPF

          The actor who rolled a skill

        • result: any

          The roll result, either as ChatMessage if one was created, or as object containing data that would have been used to create one.

        • skill: string

          The ID of the skill that was rolled

        Returns void

    Called by Hooks.callAll

    pf1PreActorRollAbility: (
        actor: ActorPF,
        options: D20ActorRollOptions,
        ability: string,
    ) => boolean

    A hook event fired by the system when an ActorPF rolls an ability check.

    Type Declaration

      • (actor: ActorPF, options: D20ActorRollOptions, ability: string): boolean
      • Parameters

        • actor: ActorPF

          The actor rolling an ability check

        • options: D20ActorRollOptions

          Additional options for the roll

        • ability: string

          The key of the ability being rolled

        Returns boolean

        Explicitly return false to prevent the actor from rolling the ability check.

    Called by Hooks.call

    pf1PreActorRollBab: (actor: ActorPF, options: D20ActorRollOptions) => boolean

    A hook event fired by the system when an ActorPF rolls their BAB.

    Type Declaration

    Called by Hooks.call

    pf1PreActorRollCl: (
        actor: ActorPF,
        options: D20ActorRollOptions,
        spellbook: string,
    ) => boolean

    A hook event fired by the system when an ActorPF rolls a caster level check.

    Type Declaration

      • (actor: ActorPF, options: D20ActorRollOptions, spellbook: string): boolean
      • Parameters

        • actor: ActorPF

          The actor rolling a caster level check

        • options: D20ActorRollOptions

          Additional options for the roll

        • spellbook: string

          The key of the spellbook whose caster level is rolled

        Returns boolean

        Explicitly return false to prevent the actor from rolling the caster level check.

    Called by Hooks.call

    pf1PreActorRollConcentration: (
        actor: ActorPF,
        options: D20ActorRollOptions,
        spellbook: string,
    ) => boolean

    A hook event fired by the system when an ActorPF rolls a concentration check.

    Type Declaration

      • (actor: ActorPF, options: D20ActorRollOptions, spellbook: string): boolean
      • Parameters

        • actor: ActorPF

          The actor rolling a concentration check

        • options: D20ActorRollOptions

          Additional options for the roll

        • spellbook: string

          The key of the spellbook whose concentration is rolled

        Returns boolean

        Explicitly return false to prevent the actor from rolling the concentration check.

    Called by Hooks.call

    pf1PreActorRollSave: (
        actor: ActorPF,
        options: D20ActorRollOptions,
        save: "fort" | "ref" | "will",
    ) => boolean

    A hook event fired by the system when an ActorPF rolls a save.

    Type Declaration

      • (
            actor: ActorPF,
            options: D20ActorRollOptions,
            save: "fort" | "ref" | "will",
        ): boolean
      • Parameters

        • actor: ActorPF

          The actor rolling a save

        • options: D20ActorRollOptions

          Additional options for the roll

        • save: "fort" | "ref" | "will"

          The key of the save being rolled

        Returns boolean

        Explicitly return false to prevent the actor from rolling the save.

    Called by Hooks.call

    pf1PreActorRollSkill: (
        actor: ActorPF,
        options: D20ActorRollOptions,
        skill: string,
    ) => boolean

    A hook event fired by the system when an ActorPF rolls a skill.

    Type Declaration

      • (actor: ActorPF, options: D20ActorRollOptions, skill: string): boolean
      • Parameters

        • actor: ActorPF

          The actor rolling a skill

        • options: D20ActorRollOptions

          Additional options for the roll

        • skill: string

          The ID of the skill being rolled

        Returns boolean

        Explicitly return false to prevent the actor from rolling the skill.

    Called by Hooks.call

    Actor Sheet

    renderPF1ExtendedTooltip: (
        sheet: ActorSheet,
        id: string,
        template: DocumentFragment,
    ) => void

    Extended tooltip render hook just before tooltip is activated.

    Type Declaration

      • (sheet: ActorSheet, id: string, template: DocumentFragment): void
      • Parameters

        • sheet: ActorSheet

          Linked sheet

        • id: string

          Tooltip ID

        • template: DocumentFragment

          HTML document fragment providing live DOM to the tooltip.

        Returns void

    Called by Hooks.callAll

    PF1 v10

    Changes

    pf1AddDefaultChanges: (actor: ActorPF, changes: Change[]) => void

    A hook event fired by the system when an actor's data is prepared and the system adds inherent/default Changes.

    Type Declaration

      • (actor: ActorPF, changes: Change[]): void
      • Parameters

        • actor: ActorPF

          The actor whose data is being prepared.

        • changes: Change[]

          An array of default changes to be applied to the actor.

        Returns void

    Called by Hooks.callAll

    Hooks.on("pf1AddDefaultChanges", (actor, changes) => {
    changes.push(
    new pf1.models.components.Change({
    target: "str",
    formula: "2",
    })
    );
    });
    pf1GetChangeFlat: (
        result: string[],
        target:
            | "attack"
            | "size"
            | "skills"
            | "skill"
            | "damage"
            | "acpA"
            | "acpS"
            | "mDexA"
            | "mDexS"
            | "str"
            | "dex"
            | "con"
            | "int"
            | "wis"
            | "cha"
            | "strMod"
            | "dexMod"
            | "conMod"
            | "intMod"
            | "wisMod"
            | "chaMod"
            | "strPen"
            | "dexPen"
            | "conPen"
            | "intPen"
            | "wisPen"
            | "chaPen"
            | "~strDrain"
            | "~dexDrain"
            | "~conDrain"
            | "~intDrain"
            | "~wisDrain"
            | "~chaDrain"
            | "carryStr"
            | "carryMult"
            | "reach"
            | "ageCategory"
            | "ageCategoryPhysical"
            | "ageCategoryMental"
            | "unskills"
            | "strSkills"
            | "dexSkills"
            | "conSkills"
            | "intSkills"
            | "wisSkills"
            | "chaSkills"
            | "skill.knowledge"
            | "allChecks"
            | "strChecks"
            | "dexChecks"
            | "conChecks"
            | "intChecks"
            | "wisChecks"
            | "chaChecks"
            | "landSpeed"
            | "climbSpeed"
            | "swimSpeed"
            | "burrowSpeed"
            | "flySpeed"
            | "allSpeeds"
            | "ac"
            | "aac"
            | "sac"
            | "nac"
            | "tac"
            | "ffac"
            | "bab"
            | "~attackCore"
            | "wattack"
            | "sattack"
            | "mattack"
            | "nattack"
            | "rattack"
            | "tattack"
            | "wdamage"
            | "mwdamage"
            | "rwdamage"
            | "twdamage"
            | "rdamage"
            | "mdamage"
            | "ndamage"
            | "sdamage"
            | "critConfirm"
            | "allSavingThrows"
            | "fort"
            | "ref"
            | "will"
            | "vehicleSave"
            | "cmb"
            | "cmd"
            | "ffcmd"
            | "init"
            | "mhp"
            | "wounds"
            | "vigor"
            | "woundThreshold"
            | "spellResist"
            | "bonusFeats"
            | "bonusSkillRanks"
            | "concentration"
            | "cl"
            | "concn"
            | "dc"
            | "asf"
            | "senselv"
            | "sensedv"
            | "sensets"
            | "sensebse"
            | "sensebs"
            | "sensels"
            | "sensesc"
            | "sensetr"
            | "senseths"
            | string & {},
        modifierType:
            | "haste"
            | "base"
            | "untyped"
            | "untypedPerm"
            | "enh"
            | "dodge"
            | "inherent"
            | "deflection"
            | "morale"
            | "luck"
            | "sacred"
            | "insight"
            | "resist"
            | "profane"
            | "trait"
            | "racial"
            | "size"
            | "competence"
            | "circumstance"
            | "alchemical"
            | string & {}
            | undefined,
        value: number | undefined,
        actor: ActorPF,
    ) => void

    A hook event fired by the system when the system determines which data fields a change target should affect, i.e. flattens the change target to target data fields. This is called for every Change on every actor for every data preparation, so callbacks should be efficient.

    Type Declaration

      • (
            result: string[],
            target:
                | "attack"
                | "size"
                | "skills"
                | "skill"
                | "damage"
                | "acpA"
                | "acpS"
                | "mDexA"
                | "mDexS"
                | "str"
                | "dex"
                | "con"
                | "int"
                | "wis"
                | "cha"
                | "strMod"
                | "dexMod"
                | "conMod"
                | "intMod"
                | "wisMod"
                | "chaMod"
                | "strPen"
                | "dexPen"
                | "conPen"
                | "intPen"
                | "wisPen"
                | "chaPen"
                | "~strDrain"
                | "~dexDrain"
                | "~conDrain"
                | "~intDrain"
                | "~wisDrain"
                | "~chaDrain"
                | "carryStr"
                | "carryMult"
                | "reach"
                | "ageCategory"
                | "ageCategoryPhysical"
                | "ageCategoryMental"
                | "unskills"
                | "strSkills"
                | "dexSkills"
                | "conSkills"
                | "intSkills"
                | "wisSkills"
                | "chaSkills"
                | "skill.knowledge"
                | "allChecks"
                | "strChecks"
                | "dexChecks"
                | "conChecks"
                | "intChecks"
                | "wisChecks"
                | "chaChecks"
                | "landSpeed"
                | "climbSpeed"
                | "swimSpeed"
                | "burrowSpeed"
                | "flySpeed"
                | "allSpeeds"
                | "ac"
                | "aac"
                | "sac"
                | "nac"
                | "tac"
                | "ffac"
                | "bab"
                | "~attackCore"
                | "wattack"
                | "sattack"
                | "mattack"
                | "nattack"
                | "rattack"
                | "tattack"
                | "wdamage"
                | "mwdamage"
                | "rwdamage"
                | "twdamage"
                | "rdamage"
                | "mdamage"
                | "ndamage"
                | "sdamage"
                | "critConfirm"
                | "allSavingThrows"
                | "fort"
                | "ref"
                | "will"
                | "vehicleSave"
                | "cmb"
                | "cmd"
                | "ffcmd"
                | "init"
                | "mhp"
                | "wounds"
                | "vigor"
                | "woundThreshold"
                | "spellResist"
                | "bonusFeats"
                | "bonusSkillRanks"
                | "concentration"
                | "cl"
                | "concn"
                | "dc"
                | "asf"
                | "senselv"
                | "sensedv"
                | "sensets"
                | "sensebse"
                | "sensebs"
                | "sensels"
                | "sensesc"
                | "sensetr"
                | "senseths"
                | string & {},
            modifierType:
                | "haste"
                | "base"
                | "untyped"
                | "untypedPerm"
                | "enh"
                | "dodge"
                | "inherent"
                | "deflection"
                | "morale"
                | "luck"
                | "sacred"
                | "insight"
                | "resist"
                | "profane"
                | "trait"
                | "racial"
                | "size"
                | "competence"
                | "circumstance"
                | "alchemical"
                | string & {}
                | undefined,
            value: number | undefined,
            actor: ActorPF,
        ): void
      • Parameters

        • result: string[]

          An array of target data fields.

        • target:
              | "attack"
              | "size"
              | "skills"
              | "skill"
              | "damage"
              | "acpA"
              | "acpS"
              | "mDexA"
              | "mDexS"
              | "str"
              | "dex"
              | "con"
              | "int"
              | "wis"
              | "cha"
              | "strMod"
              | "dexMod"
              | "conMod"
              | "intMod"
              | "wisMod"
              | "chaMod"
              | "strPen"
              | "dexPen"
              | "conPen"
              | "intPen"
              | "wisPen"
              | "chaPen"
              | "~strDrain"
              | "~dexDrain"
              | "~conDrain"
              | "~intDrain"
              | "~wisDrain"
              | "~chaDrain"
              | "carryStr"
              | "carryMult"
              | "reach"
              | "ageCategory"
              | "ageCategoryPhysical"
              | "ageCategoryMental"
              | "unskills"
              | "strSkills"
              | "dexSkills"
              | "conSkills"
              | "intSkills"
              | "wisSkills"
              | "chaSkills"
              | "skill.knowledge"
              | "allChecks"
              | "strChecks"
              | "dexChecks"
              | "conChecks"
              | "intChecks"
              | "wisChecks"
              | "chaChecks"
              | "landSpeed"
              | "climbSpeed"
              | "swimSpeed"
              | "burrowSpeed"
              | "flySpeed"
              | "allSpeeds"
              | "ac"
              | "aac"
              | "sac"
              | "nac"
              | "tac"
              | "ffac"
              | "bab"
              | "~attackCore"
              | "wattack"
              | "sattack"
              | "mattack"
              | "nattack"
              | "rattack"
              | "tattack"
              | "wdamage"
              | "mwdamage"
              | "rwdamage"
              | "twdamage"
              | "rdamage"
              | "mdamage"
              | "ndamage"
              | "sdamage"
              | "critConfirm"
              | "allSavingThrows"
              | "fort"
              | "ref"
              | "will"
              | "vehicleSave"
              | "cmb"
              | "cmd"
              | "ffcmd"
              | "init"
              | "mhp"
              | "wounds"
              | "vigor"
              | "woundThreshold"
              | "spellResist"
              | "bonusFeats"
              | "bonusSkillRanks"
              | "concentration"
              | "cl"
              | "concn"
              | "dc"
              | "asf"
              | "senselv"
              | "sensedv"
              | "sensets"
              | "sensebse"
              | "sensebs"
              | "sensels"
              | "sensesc"
              | "sensetr"
              | "senseths"
              | string & {}

          The change target as per the change's target property, see Change#target and change targets.

        • modifierType:
              | "haste"
              | "base"
              | "untyped"
              | "untypedPerm"
              | "enh"
              | "dodge"
              | "inherent"
              | "deflection"
              | "morale"
              | "luck"
              | "sacred"
              | "insight"
              | "resist"
              | "profane"
              | "trait"
              | "racial"
              | "size"
              | "competence"
              | "circumstance"
              | "alchemical"
              | string & {}
              | undefined

          The change type as per the change's modifier property, see Change#type and change types.

        • value: number | undefined

          The numerical change value, if any.

        • actor: ActorPF

          The actor the change is being applied to.

        Returns void

    Called by Hooks.callAll

    // Add a change target
    Hooks.once("init", () => {
    CONFIG.PF1.buffTargets.gp = {
    label: "Gold Pieces",
    category: "misc",
    };
    });
    // Define the correct data field for the change to target
    Hooks.on("pf1GetChangeFlat", (result, target, modifierType, value, actor) => {
    if (target === "gp") {
    result.push("system.currency.gp");
    }
    });

    Combat

    pf1CombatTurnSkip: (
        combat: CombatPF,
        skipped: Set<CombatantPF>,
        context: Record<string, unknown>,
    ) => void

    Hook event fired when turns are skipped in combat.

    Type Declaration

      • (
            combat: CombatPF,
            skipped: Set<CombatantPF>,
            context: Record<string, unknown>,
        ): void
      • Parameters

        • combat: CombatPF

          Relevant combat instance

        • skipped: Set<CombatantPF>

          Set of combatants whose turn was passed over.

        • context: Record<string, unknown>

          Combat update context object.

        Returns void

    Called by Hooks.callAll

    D20 Rolls

    pf1PreD20Roll: (
        roll: D20RollPF,
        options: Partial<D20ActorRollOptions>,
    ) => boolean

    A hook event fired by the system when a pf1.dice.d20Roll is rolled. Primarily used by actor non-attack rolls (e.g. skills, attributes, etc).

    Type Declaration

      • (roll: D20RollPF, options: Partial<D20ActorRollOptions>): boolean
      • Parameters

        • roll: D20RollPF

          The roll object, before it's evaluated

        • options: Partial<D20ActorRollOptions>

          Options used to create the roll

        Returns boolean

        Explicitly return false to prevent the roll.

    Called by Hooks.call

    Initialization

    pf1PostInit: () => void

    A hook event fired by the system when it has finished its own init phase.

    Called by Hooks.callAll

    pf1PostReady: () => void

    A hook event fired by the system when it has finished its own ready phase. As the system's ready hook is asynchronous, this is the only hook that guarantees that the system is ready. The default ready hook includes no such guarantee.

    Called by Hooks.callAll

    pf1PostSetup: () => void

    A hook event fired by the system when it has finished its own setup phase.

    Called by Hooks.callAll

    Item

    pf1ClassLevelChange: (
        actor: ActorPF,
        classItem: ItemPF<ClassModel>,
        currentLevel: number,
        newLevel: number,
    ) => void

    A hook event fired by the system when the level of a class item is changed.

    Type Declaration

      • (
            actor: ActorPF,
            classItem: ItemPF<ClassModel>,
            currentLevel: number,
            newLevel: number,
        ): void
      • Parameters

        • actor: ActorPF

          The actor whose class item's level is being changed.

        • classItem: ItemPF<ClassModel>

          The class item whose level is being changed.

        • currentLevel: number

          The current level of the class item.

        • newLevel: number

          The new level of the class item.

        Returns void

    Called by Hooks.callAll

    pf1DisplayCard: (
        item: ItemPF,
        data: {
            msgData: Record<string, unknown>;
            template: string;
            templateData: Record<string, unknown>;
        },
    ) => boolean

    A hook event fired by the system when an item's chat card is to be displayed.

    Type Declaration

      • (
            item: ItemPF,
            data: {
                msgData: Record<string, unknown>;
                template: string;
                templateData: Record<string, unknown>;
            },
        ): boolean
      • Parameters

        • item: ItemPF

          The item whose chat card is being displayed.

        • data: {
              msgData: Record<string, unknown>;
              template: string;
              templateData: Record<string, unknown>;
          }

          Data related to the item's use.

          • msgData: Record<string, unknown>

            The data passed to ChatMessage.create (excluding content from the rendered template)

          • template: string

            The path of the template used to render the chat card

          • templateData: Record<string, unknown>

            The data to be passed to the foundry.utils.renderTemplate call. The contents of this object can change unexpectedly, as each change to the system's chat card template or item data will affect it.

        Returns boolean

        Explicitly return false to prevent the item's chat card from being displayed.

    Called by Hooks.call

    Item Links

    pf1CreateItemLink: (
        item: ItemPF,
        link: ItemLink,
        kind: "children" | "charges" | "classAssociations" | "ammunition",
    ) => void

    A hook event fired by the system after an item link is created.

    Type Declaration

      • (
            item: ItemPF,
            link: ItemLink,
            kind: "children" | "charges" | "classAssociations" | "ammunition",
        ): void
      • Parameters

        • item: ItemPF

          The item on which the link is being created.

        • link: ItemLink

          The link being created.

        • kind: "children" | "charges" | "classAssociations" | "ammunition"

          The kind of link being created.

        Returns void

    Called by Hooks.callAll

    pf1DeleteItemLink: (
        item: ItemPF,
        link: ItemLink,
        kind: "children" | "charges" | "classAssociations" | "ammunition",
    ) => void

    A hook event fired by the system after an item link is deleted.

    Type Declaration

      • (
            item: ItemPF,
            link: ItemLink,
            kind: "children" | "charges" | "classAssociations" | "ammunition",
        ): void
      • Parameters

        • item: ItemPF

          The item whose links data was changed.

        • link: ItemLink

          Link data that was deleted.

        • kind: "children" | "charges" | "classAssociations" | "ammunition"

          The type of the link that was deleted.

        Returns void

    Called by Hooks.callAll

    Migration

    pf1MigrationFinished: () => void

    A hook event fired by the system when it has finished its migration.

    Called by Hooks.callAll

    pf1MigrationStarted: () => void

    A hook event fired by the system when it starts its migration.

    Called by Hooks.callAll

    Party

    pf1PartyRest: (config: object) => void

    Party rest hook fired after all actors have rested and time has been passed.

    Type Declaration

      • (config: object): void
      • Parameters

        • config: object

          Rest configuration object

        Returns void

    pf1PrePartyRest: (config: object) => void

    Party rest hook fired just before the configuration is used to rest the actors and pass time.

    Type Declaration

      • (config: object): void
      • Parameters

        • config: object

          Rest configuration object

        Returns void

        Explicitly return false to prevent party resting.

    Roll Data

    pf1GetRollData: (
        document: ActorPF<BaseActorModel> | Action | ItemPF<BaseItemModel>,
        data: Record<string, unknown>,
    ) => void

    A hook event fired by the system when roll data is created. The hook is fired at the end of the system's roll data creation process.

    Type Declaration

    Called by Hooks.callAll

    • pf1.documents.actor.ActorPF.getRollData ActorPF#getRollData
    • pf1.documents.item.ItemPF.getRollData ItemPF#getRollData
    • pf1.models.item.BaseItemModel#getRollData BaseItemModel#getRollData
    • pf1.components.Action.getRollData ItemAction#getRollData

    Sheet Events

    pf1DropContainerSheetData: (
        item: ItemPF<ContainerModel>,
        sheet: ContainerSheetPF,
        data: Record<string, unknown>,
    ) => boolean

    A hook event fired by the system when data is dropped onto an ContainerSheetPF.

    Type Declaration

      • (
            item: ItemPF<ContainerModel>,
            sheet: ContainerSheetPF,
            data: Record<string, unknown>,
        ): boolean
      • Parameters

        Returns boolean

        Explicitly return false to prevent the drop event from being handled.

    Called by Hooks.call