Eranio
Color theme

Mutes

Base: /api/mutes

With mutes you keep a list of players who should not write, with a reason, a moderator and an optional expiry. The section suits a moderation panel or a Discord command. The mod manages the list in the file mutes.json. From version 1.17.2 the mod enforces the mute in the game itself: when a muted player writes in chat, the message is dropped and the player sees a notice with the remaining time and the reason. The message does not end up in the chat history either. Commands are not affected. Expired mutes end by themselves, you do not have to lift them. Up to version 1.17.1 the list was only stored and not checked when someone chatted.

Handler: MutesHandler
GET /api/mutes

List mutes

Returns all active mutes with player, reason, mutedBy, timestamp (time of the mute as text) and expiresAt (end as a millisecond timestamp, 0 for permanent).

Response Example

[
  {
    "player": "Steve",
    "reason": "spam",
    "mutedBy": "Admin",
    "durationMinutes": 30,
    "expiresAt": 1737003600000
  }
]

cURL

curl -X GET 'http://localhost:5550/api/mutes' \
  -H 'X-Admin-Token: YOUR_TOKEN'
Expired entries are removed from the list automatically when you fetch it. The list only says who is registered. The mod does not block chatting itself (see the description of the section).

Internal Behavior

Reads mutes.json in the mod folder.
POST /api/mutes

Mute player

Adds a player to the list of mutes. The response contains success, player, reason and duration_minutes.

Request Body

Field Type Required Description
player string Yes Player name
reason string No Reason
muted_by string No Moderator, default Server
duration_minutes integer No Minutes, 0 = permanent (default)

Response Example

{
  "success": true,
  "player": "Steve",
  "reason": "spam",
  "duration_minutes": 30
}

cURL

curl -X POST 'http://localhost:5550/api/mutes' \
  -H 'X-Admin-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"player": "Spammer", "reason": "Spam", "muted_by": "Eranio", "duration_minutes": 60}'
Only player is required, and if it is missing you get 400 with "Missing required field: player". duration_minutes is the duration in minutes, 0 or omitted means permanent. muted_by defaults to "Server". The name is stored in lowercase as the key, so a second call for the same player overwrites the existing entry and resets the duration.

Internal Behavior

Writes the entry to mutes.json. From version 1.17.2 the mute takes effect immediately, no restart is needed.
DELETE /api/mutes/{player}

Unmute player

Removes a mute.

Parameters

Name Type Required Description
player string Yes Player name

Response Example

{
  "success": true,
  "player": "Steve"
}

cURL

curl -X DELETE 'http://localhost:5550/api/mutes/Griefer123' \
  -H 'X-Admin-Token: YOUR_TOKEN'
The endpoint also answers with success: true when the player was not registered at all. If the name is missing in the address, you get 400 with "Player name required".

Internal Behavior

Removes the entry from mutes.json.