# Private Messages

Player-to-player messages with automatic reply tracking, plus a broadcast command for server-wide announcements. For public chat see [Chat Format](chat.md).

## Commands

| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
| `/msg` (alias `/tell`, `/whisper`, `/w`, `/pm`, `/dm`, `/message`) | `/msg <player> <message>` | `msg.send` | `true` | Sends a private message |
| `/reply` (alias `/r`) | `/reply <message>` | `msg.reply` | `true` | Replies to the last sender |
| `/broadcast` (alias `/bc`) | `/broadcast <message>` | `msg.broadcast` | op | Server-wide announcement to all players and the console |

## Additional permissions

| Permission | Default | Description |
|---|---|---|
| `msg.bypass.mute` | false | Private messages despite a mute (also needs `mod.bypass.mute`, see [Moderation](moderation.md#commands)) |

> **Note:** Messages to yourself, to offline players and to vanished players (without the see permission) are blocked. Click and hover effects are stripped from every message, the rest of the text arrives exactly as typed (`<` and `\` included). The [claim module's](claim-pvp.md) ignore list and soft mute apply to `/msg` and `/r` as well: someone ignoring you gets no message (you are told); a soft-muted player sees their own line, the recipient nothing. The moderation module's word filter applies here too. Admins with `/socialspy` can read private messages (see [Moderation](moderation.md#commands)).

> **Tip:** A small `/msg` cooldown (2 to 3 seconds) curbs spam without disturbing conversations. `/reply` is not affected.

## Configuration (modules/messaging.yml)

```yaml
# Enables or disables private messages and broadcast.
enabled: true

messaging:
  # Display for the sender. Placeholders: <target>, <message>
  sender-format: "<gray>[<green>You <gray>-> <green><target><gray>] <white><message>"
  # Display for the receiver. Placeholders: <sender>, <message>
  receiver-format: "<gray>[<green><sender> <gray>-> <green>You<gray>] <white><message>"
  # Maximum message length for /msg and /reply.
  max-length: 256

cooldown:
  commands:
    # Seconds between two /msg of the same player. 0 = no cooldown.
    # Applies to /msg only, not /reply.
    msg: 0
```

The broadcast uses the `messaging.broadcast-format` from `messages.yml` and parses MiniMessage fully (only admins may use it).

## Complete example config

```yaml
enabled: true

messaging:
  sender-format: "<dark_gray>[<aqua>You <dark_gray>-> <aqua><target><dark_gray>] <white><message>"
  receiver-format: "<dark_gray>[<aqua><sender> <dark_gray>-> <aqua>You<dark_gray>] <white><message>"
  max-length: 200

cooldown:
  commands:
    msg: 3
```
