Chat
Base: /api/chat
Send server chat messages and broadcast functions
Handler: ChatHandler
POST
/api/chat/send
Send Chat Message
Sends a message to all players in chat.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
message
|
string | Yes | The message to send |
sender
|
string | No | Sender name (default: [Server]) |
Response Example
{"success":true,"message":"Chat message sent"}
cURL
curl -X POST http://localhost:5550/api/chat/send \
-H 'Content-Type: application/json' \
-d '{"message":"Hallo an alle!","sender":"Admin"}'
Internal Behavior
Uses server.broadcastMessage() for global messages.
Supports color codes with & prefix.
Supports color codes with & prefix.
POST
/api/chat/send/{player}
Private Message
Sends a private message to a specific player.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
player
|
string | Yes | Recipient player name |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
message
|
string | Yes | The message |
Response Example
{"success":true,"message":"Private message sent to Steve"}
cURL
curl -X POST http://localhost:5550/api/chat/send/Steve \
-H 'Content-Type: application/json' \
-d '{"message":"Hey Steve!"}'