Bans
Base: /api/bans
Manage player bans (list, add, remove)
Handler: BanHandler
GET
/api/bans
Ban List
List of all banned players.
Response Example
[{"player":"Griefer123","reason":"Griefing","banned_by":"Admin","banned_at":"2025-01-15T10:30:00Z","expires":null}]
cURL
curl http://localhost:5550/api/bans
POST
/api/bans/add
Ban Player
Bans a player from the server.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
player
|
string | Yes | Player name |
reason
|
string | No | Ban reason |
duration
|
string | No | Ban duration (e.g. "7d", "24h", "permanent") |
Response Example
{"success":true,"message":"Player Griefer123 has been banned"}
cURL
curl -X POST http://localhost:5550/api/bans/add \
-H 'Content-Type: application/json' \
-d '{"player":"Griefer123","reason":"Griefing","duration":"7d"}'
Internal Behavior
Saves ban to data/bans.json.
Kicks the player immediately if online.
Ban expiry is checked on login.
Kicks the player immediately if online.
Ban expiry is checked on login.
DELETE
/api/bans/{player}
Unban Player
Removes a player's ban.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
player
|
string | Yes | Player name |
Response Example
{"success":true,"message":"Player Griefer123 has been unbanned"}
cURL
curl -X DELETE http://localhost:5550/api/bans/Griefer123