Skip to content
BasaltSoftware
Bedrock 1.26.60

Site colour

Discord
Esc

    ↑↓ moveEnter openEsc close

    Keyboard shortcuts
    Ctrl K
    Search the whole site, from any page
    /
    Jump to the sidebar search, or search the whole site where there isn't one
    Enter
    Open the top search result
    Esc
    Clear the search, or close this panel
    ?
    Show these shortcuts
    Before events

    ChatSendBeforeEvent

    The ChatSendBeforeEvent interface in @minecraft/server.

    Interface in @minecraft/server

    Extends CancellableEvent

    import type { ChatSendBeforeEvent } from '@minecraft/server';

    Subscribe to it with world.beforeEvents.chatSend.

    import { world, type ChatSendBeforeEvent } from '@minecraft/server';
    world.beforeEvents.chatSend.subscribe((event: ChatSendBeforeEvent) => {
    console.log('chatSend', event.sender.name, event.message);
    // Uncomment to stop it from happening.
    // event.cancel = true;
    });
    import { world } from '@minecraft/server';
    world.beforeEvents.chatSend.subscribe((event) => {
    console.log('chatSend', event.sender.name, event.message);
    // Uncomment to stop it from happening.
    // event.cancel = true;
    });

    read-only

    readonly sender: Player;
    Types
    message: string;

    The message, which handlers may change.

    WorldBeforeEvents.chatSend

    From CancellableEvent: cancel