Saxonberg Server API
    Preparing search index...

    Interface ExecuteCommandOpts

    Optional ingress carry-throughs executeCommand accepts from the caller. The dispatcher derives everything else (commandGiver from this, location from the giver's container, execution / command ids).

    interface ExecuteCommandOpts {
        barId?: string;
        bodyFields?: Record<string, unknown>;
        forced?: boolean;
        interactive?: default;
    }
    Index

    Properties

    barId?: string

    Which input region (command bar) the command was submitted from. Threaded from the inbound command message so the input-mode prepend (CommandApi.applyInputMode) looks up that bar's prefix in cockpit.inputModes, and so ModeController knows which bar a mode verb targets. Defaults to 'main'; absent for scripts / NPC / forced dispatch (no bar, no prefix applied).

    bodyFields?: Record<string, unknown>

    Optional structured body side-channel from the command inbound ({type:'command', payload:{ text, fields? }}). Overlaid onto the bound model's payload:/designated body fields after the string parses, via CommandApi.overlayBodyFields. The command string is always parsed first; this never bypasses the parse/validate chain.

    forced?: boolean

    Set by CommandApi.forceCommand when the runtime fires a command on behalf of the player (auto-look on arrival, NPC scripts, scheduled triggers). The flag rides through to the Command frame's metadata so hooks can ask "am I executing inside a forced command?" via ExecutionContextApi.getCommandStack. Player-typed input defaults to false.

    interactive?: default

    The connection/session that originated the command. Cascaded / indirect commands (NPC scripting, scheduled triggers) may omit this; controllers must tolerate context.interactive being undefined.