A set of events that fire before an actual action occurs. In most cases, you can potentially cancel or modify the impending event. Note that in before events any APIs that modify gameplay state will not function and will throw an error.

Implements

Constructors

Accessors

  • get shutdown(): {
        getAll(): Globals.SubscribedEvent<
            "system.beforeEvents.shutdown",
            ShutdownBeforeEventSignal,
        >[];
        subscribe(
            callback: string,
        ): Globals.SubscribedEvent<"system.beforeEvents.shutdown">;
        unsubscribe(
            subscription: Globals.SubscribedEvent<"system.beforeEvents.shutdown">,
        ): void;
    }

    Returns {
        getAll(): Globals.SubscribedEvent<
            "system.beforeEvents.shutdown",
            ShutdownBeforeEventSignal,
        >[];
        subscribe(
            callback: string,
        ): Globals.SubscribedEvent<"system.beforeEvents.shutdown">;
        unsubscribe(
            subscription: Globals.SubscribedEvent<"system.beforeEvents.shutdown">,
        ): void;
    }

    • getAll:function
    • subscribe:function
      • Creates a new event subscription.

        Parameters

        • callback: string

        Returns Globals.SubscribedEvent<"system.beforeEvents.shutdown">

        This function can't be called in read-only mode.

        This function can be called in early-execution mode.

        If the event callback is an empty string.

        If the event callback is not a string.

        If the event callback is not a valid stringified JavaScript function.

    • unsubscribe:function
      • Deletes the provided event subscription.

        Parameters

        Returns void

        This function can't be called in read-only mode.

        This function can be called in early-execution mode.

        If the subscription is not an instance of SubscribedEvent.

        If the subscription is not for the system.beforeEvents.shutdown event.

    This property can be read in early-execution mode.

  • get startup(): {
        getAll(): Globals.SubscribedEvent<
            "system.beforeEvents.startup",
            StartupBeforeEventSignal,
        >[];
        subscribe(
            callback: string,
        ): Globals.SubscribedEvent<"system.beforeEvents.startup">;
        unsubscribe(
            subscription: Globals.SubscribedEvent<"system.beforeEvents.startup">,
        ): void;
    }

    Returns {
        getAll(): Globals.SubscribedEvent<
            "system.beforeEvents.startup",
            StartupBeforeEventSignal,
        >[];
        subscribe(
            callback: string,
        ): Globals.SubscribedEvent<"system.beforeEvents.startup">;
        unsubscribe(
            subscription: Globals.SubscribedEvent<"system.beforeEvents.startup">,
        ): void;
    }

    • getAll:function
    • subscribe:function
      • Creates a new event subscription.

        Parameters

        • callback: string

        Returns Globals.SubscribedEvent<"system.beforeEvents.startup">

        This function can't be called in read-only mode.

        This function can be called in early-execution mode.

        If the event callback is an empty string.

        If the event callback is not a string.

        If the event callback is not a valid stringified JavaScript function.

    • unsubscribe:function
      • Deletes the provided event subscription.

        Parameters

        Returns void

        This function can't be called in read-only mode.

        This function can be called in early-execution mode.

        If the subscription is not an instance of SubscribedEvent.

        If the subscription is not for the system.beforeEvents.startup event.

    This property can be read in early-execution mode.

  • get watchdogTerminate(): {
        getAll(): Globals.SubscribedEvent<
            "system.beforeEvents.watchdogTerminate",
            WatchdogTerminateBeforeEventSignal,
        >[];
        subscribe(
            callback: string,
        ): Globals.SubscribedEvent<"system.beforeEvents.watchdogTerminate">;
        unsubscribe(
            subscription: Globals.SubscribedEvent<
                "system.beforeEvents.watchdogTerminate",
            >,
        ): void;
    }

    Returns {
        getAll(): Globals.SubscribedEvent<
            "system.beforeEvents.watchdogTerminate",
            WatchdogTerminateBeforeEventSignal,
        >[];
        subscribe(
            callback: string,
        ): Globals.SubscribedEvent<"system.beforeEvents.watchdogTerminate">;
        unsubscribe(
            subscription: Globals.SubscribedEvent<
                "system.beforeEvents.watchdogTerminate",
            >,
        ): void;
    }

    • getAll:function
    • subscribe:function
      • Creates a new event subscription.

        Parameters

        • callback: string

        Returns Globals.SubscribedEvent<"system.beforeEvents.watchdogTerminate">

        This function can't be called in read-only mode.

        This function can be called in early-execution mode.

        If the event callback is an empty string.

        If the event callback is not a string.

        If the event callback is not a valid stringified JavaScript function.

    • unsubscribe:function
      • Deletes the provided event subscription.

        Parameters

        Returns void

        This function can't be called in read-only mode.

        This function can be called in early-execution mode.

        If the subscription is not an instance of SubscribedEvent.

        If the subscription is not for the system.beforeEvents.watchdogTerminate event.

    Fires when the scripting watchdog shuts down the server. The can be due to using too much memory, or by causing significant slowdown or hang. To prevent shutdown, set the event's cancel property to true.

    This property can be read in early-execution mode.