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

    The hook provides the pending document instance which will be used for the Document creation. Hooked functions may modify the pending document with updateSource, or prevent the workflow entirely by returning false.

    preCreateDocument

    Parameters

    • document: Document

      The pending document which is requested for creation

    • data: object

      The initial data object provided to the document creation request

    • options: DatabaseCreateOperation

      Additional options which modify the creation request

    • userId: string

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

    Returns boolean | void

    Explicitly return false to prevent creation of this Document