Skip to content

πŸ“§ Mail System Configuration ​

DANGER

These files were created automatically and should not be edited manually to avoid errors. Instead, use the commands from Essentials Plus (/mail send and /mail delete).

File Information

πŸ“ File Location: mods/fof1092_EssentialsPlus/mails/
πŸ”™ Back to Configuration Overview

The mails/ directory contains individual JSON files for each player's mailbox. Each mailbox is stored in a file named by the player's UUID: uuid.json.

Example Mailbox File (mails/123e4567-e89b-12d3-a456-426614174000.json):

json
{
  "playerUuid": "123e4567-e89b-12d3-a456-426614174000",
  "inbox": [
    {
      "id": 1,
      "senderUuid": "987e6543-e21b-12d3-a456-426614174999",
      "senderUsername": "Admin",
      "recipientUuid": "123e4567-e89b-12d3-a456-426614174000",
      "subject": "Welcome to the server!",
      "message": "Welcome to the server! Enjoy your stay and follow the rules.",
      "timestamp": 1738234567890,
      "read": false,
      "attachment": null
    },
    {
      "id": 2,
      "senderUuid": "456e7890-a12b-34c5-d678-901234567890",
      "senderUsername": "Player2",
      "recipientUuid": "123e4567-e89b-12d3-a456-426614174000",
      "subject": "Thanks for the help!",
      "message": "Thanks for the help with the build! Really appreciate it.",
      "timestamp": 1738320967890,
      "read": true,
      "attachment": null
    }
  ],
  "sent": [
    {
      "id": 1,
      "senderUuid": "123e4567-e89b-12d3-a456-426614174000",
      "senderUsername": "Player1",
      "recipientUuid": "456e7890-a12b-34c5-d678-901234567890",
      "subject": "No problem!",
      "message": "No problem! Let me know if you need more help.",
      "timestamp": 1738321200000,
      "read": false,
      "attachment": null
    }
  ],
  "lastSendTime": 1738321200000,
  "lastMessageHash": 1234567890,
  "nextMailId": 3
}

Mailbox Properties:

  • playerUuid - Player's unique identifier
  • inbox - Array of received mails
    • Contains mails sent to this player by other players
    • Each mail has a unique ID within the mailbox
  • sent - Array of sent mails
    • Contains mails sent by this player to others
    • Allows tracking of sent messages
  • lastSendTime - Timestamp of last mail sent (milliseconds)
    • Used for spam protection cooldown
  • lastMessageHash - Hash of last message content
    • Used for text similarity spam detection
  • nextMailId - Next available mail ID for this mailbox
    • Auto-increments with each new mail

Mail Properties:

  • id - Unique mail ID within the mailbox
  • senderUuid - UUID of the player who sent the mail
  • senderUsername - Username of sender at time of sending
  • recipientUuid - UUID of the recipient player
  • subject - Mail subject (auto-generated from first 20 characters of message)
  • message - Full message content
  • timestamp - When the mail was sent (milliseconds since epoch)
  • read - Whether the recipient has read this mail
  • attachment - Optional item attachment (currently null, reserved for future use)

Features:

  • Per-Player Storage: Each player has their own mailbox file for better performance
  • Spam Protection:
    • Cooldown system prevents rapid mail sending
    • Text similarity detection prevents duplicate messages
  • Inbox Management:
    • Configurable inbox size limits
    • Auto-deletion of old mails when limit is reached
    • Separate tracking of read/unread mails
  • Sent Mail Tracking: Players can see their sent mail history
  • Real-Time Notifications:
    • Join notification for unread mails
    • Instant notification when receiving new mail
  • Filtering & Pagination: List command supports filtering (unread/read/sent) and page navigation

Related Commands:

  • /mail - View inbox
  • /mail send <player> <message> - Send mail
  • /mail sendall <message> - Send to all players (admin)
  • /mail read <number> - Read specific mail
  • /mail list [--page=X] [--filter=unread/read/sent] - List mails
  • /mail delete <number|all> - Delete mail(s)
  • /mail clear - Clear all mails
  • /mail reply <number> <message> - Reply to mail

Permissions:

  • essentialsplus.mail - Base permission for mail system access
  • essentialsplus.mail.send - Permission to send mail
  • essentialsplus.mail.sendall - Permission to send to all players
  • essentialsplus.mail.delete - Permission to delete own mails
  • essentialsplus.mail.clear - Permission to clear mailbox

Note: Mailbox files are automatically created when a player first sends or receives mail. The files are saved with pretty-printing for readability. All mail operations automatically save changes to the affected mailbox files.