• A hook event that fires for every Document type before execution of an update workflow. Substitute the Document name in the hook event to target a specific Document type, for example "preUpdateActor". This hook only fires for the client who is initiating the update request.

    The hook provides the differential data which will be used to update the Document. Hooked functions may modify that data or prevent the workflow entirely by explicitly returning false.

    preUpdateDocument

    Parameters

    • document: Document

      The Document instance being updated

    • changed: object

      Differential data that will be used to update the document

    • options: DatabaseUpdateOperation

      Additional options which modify the update request

    • userId: string

      The ID of the requesting user, always game.user.id

    Returns boolean | void

    Explicitly return false to prevent update of this Document