Provides a set of events that fire within the broader scripting system within Minecraft.

Implements

Constructors

Accessors

Constructors

Accessors

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

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

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

        Parameters

        • callback: string

        Returns Globals.SubscribedEvent<"system.afterEvents.scriptEventReceive">

        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.afterEvents.scriptEventReceive event.

    An event that fires when a /scriptevent command is set. This provides a way for commands and other systems to trigger behavior within script.

    This property can be read in early-execution mode.