For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/reference/sdk/sapi/runtime/variables/Msg.md.
  • English
  • Variable: Msg

    const Msg: {
      info: (msg: string, player: Player) => void;
      error: (msg: string, player: Player) => void;
      success: (msg: string, player: Player) => void;
      warning: (msg: string, player: Player) => void;
      tips: (msg: string, player: Player) => void;
    };

    Defined in: sapi/runtime/msg.ts:33

    玩家频道消息门面。统一前缀与文本色彩规范,禁止业务模块直接调用原生的 player.sendMessage()。

    样式对应规范:

    • info → §f[*](常规信息)
    • success → §a[√](操作成功)
    • error → §c[x](错误警示)
    • warning → §e[!](重要警告)
    • tips → §7[!](补充提示 / 次要说明)

    Type Declaration

    NameTypeDescriptionDefined in
    info()(msg: string, player: Player) => void发送常规提示信息(前缀 §f[*])。sapi/runtime/msg.ts:40
    error()(msg: string, player: Player) => void发送操作失败或错误警示信息(前缀 §c[x])。sapi/runtime/msg.ts:51
    success()(msg: string, player: Player) => void发送操作成功提示信息(前缀 §a[√])。sapi/runtime/msg.ts:62
    warning()(msg: string, player: Player) => void发送警告提示信息(前缀 §e[!])。sapi/runtime/msg.ts:73
    tips()(msg: string, player: Player) => void发送次要说明或弱提示信息(前缀 §7[!])。sapi/runtime/msg.ts:84