The ScriptEventCommandMessageAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
import type { ScriptEventCommandMessageAfterEvent } from '@minecraft/server';Subscribe to it with system.afterEvents.scriptEventReceive.
Example
Section titled “Example”import { system, type ScriptEventCommandMessageAfterEvent } from '@minecraft/server';
system.afterEvents.scriptEventReceive.subscribe((event: ScriptEventCommandMessageAfterEvent) => { console.log('scriptEventReceive', event.id, event.message, event.sourceType);});import { system } from '@minecraft/server';
system.afterEvents.scriptEventReceive.subscribe((event) => { console.log('scriptEventReceive', event.id, event.message, event.sourceType);});Properties
Section titled “Properties”read-only
readonly id: string;The namespace:path id the /scriptevent carried.
message
Section titled “message”read-only
readonly message: string;Anything after the id, or an empty string.
sourceType
Section titled “sourceType”read-only
readonly sourceType: ScriptEventSource;Where it came from, a ScriptEventSource value.
Types
sourceEntity
Section titled “sourceEntity”read-only optional
readonly sourceEntity?: Entity;The entity that ran it, when one did.
Types
Used by
Section titled “Used by”SystemAfterEvents.scriptEventReceive, ScriptEventCommandMessageAfterEventSignal.subscribe, ScriptEventCommandMessageAfterEventSignal.unsubscribe