-
Notifications
You must be signed in to change notification settings - Fork 329
Hooks
A Krigline (Calego) edited this page May 3, 2022
·
33 revisions
Fires when the actor completes a short or long rest.
| Name | Type | Description |
|---|---|---|
| actor | Actor5e | The actor that just completed resting. |
| result | RestResult | Details on the completed rest. |
Fires just before a new actor is created during the transform process.
| Name | Type | Description |
|---|---|---|
| actor | Actor5e | The original actor before transformation. |
| target | Actor5e | The target actor being transformed into. |
| data | object | The merged data that will be used to create the newly-transformed actor. |
| options | TransformationOptions | Options that determine how the transformation is performed. |
Fires when an AdvancementManager is about to be processed. Returning false will prevent the normal rendering process.
| Name | Type | Description |
|---|---|---|
| advancementManager | AdvancementManager | The advancement manager about to be rendered. |
| Name | Type | Description |
|---|---|---|
| advancementManager | AdvancementManager | The advancement manager. |
| actorUpdates | object | Updates to the actor. |
| toCreate | object[] | Items that will be created on the actor. |
| toUpdate | object[] | Items that will be updated on the actor. |
| toDelete | string[] | IDs of items that will be deleted on the actor. |
Fires when an AdvancementManager is done modifying an actor.
| Name | Type | Description |
|---|---|---|
| advancementManager | AdvancementManager | The advancement manager that just completed. |
All of the normal 'pre' and 'post' hook events for document modification when an advancement manager flow finishes (Actor Update, Item Creation, Item Update, and Item Deletion) have a custom flag on them: isAdvancement. This allows a hook listener to react differently to advancement-created hook events vs normal ones.
Hooks.on('updateActor', (actor, change, options) => {
if ( options.isAdvancement ) {
// do something special
}
})