Cmail
Cmail 是一款专为 Paper (Minecraft 1.21.x+) 服务器设计的虚拟邮件与礼包系统。本插件采用 SQLite 本地数据库存储邮件数据,并支持 Vault 经济系统。具备完整的 NBT 道具保存能力,可供管理员打包礼包并进行批量指令分发,适用于服务器道具发放与自动化商城整合。
功能特性
- 安全防护机制:
- 当玩家在「放入附件」或「编辑礼包」时,若因异常断线、服务器重载或非正常关闭菜单,系统会自动将所有道具退回玩家背包。若背包空间不足,则会自然掉落于玩家所在的世界坐标,防止道具遗失或复制漏洞。
- 只读菜单全面禁用 Shift-Click 与鼠标拖曳限制,防止附件道具异常移出。
- NBT 礼包模板系统:
- 管理员可在游戏内打开 36 格界面,将含有自定义 NBT 数据(如自定义金币、特殊标签道具、Lore 武器)摆放完成并进行打包。
- 支持通过主机或控制台指令(支持以逗号分隔多位玩家名称)将打包好的礼包模板直接分发给多位玩家。
- 控制台指令整合:
- 提供
consolesend 与 sendpack 指令,可直接由控制台、RCON 或外部脚本调用以发送邮件与物品。
- 管理员后台审查:
- 管理员可调阅全服务器所有历史信件。内置安全锁机制,解锁后始可修改信件内容、调整信件附件,并支持在确认后永久删除邮件。
- Vault 经济整合:
- 可启用发信手续费与附件手续费,并在玩家寄信时显示扣款确认界面。
- 发信人自定义:
- 系统发送的信件(如礼包、后台信件)的发信人名称可于
config.yml 中自由配置,支持色彩代码。
- 自动清理机制:
- 定时自动清理过期邮件,可设定保留天数及是否清理未读/含附件邮件。
- DiscordLink 整合 (
link_dc_player):
- 收件者填入
link_dc_player,即可一次写信给所有已绑定 Discord 的玩家。
- 名单在发送当下直接从 DiscordLink 的 SQLite 数据库以只读方式读取,不需修改 DiscordLink,也不需开启其 HTTP API。
- 数据库位置会自动依照 DiscordLink 的
config.yml 中 database.sqlite-file-name 判断 (默认 plugins/DiscordLink/database.db)。
- 支持
send、sendpack、consolesend 三个指令,皆需 cmail.admin 权限。
指令与权限
本插件主指令为 /cmail。
| 指令 |
说明 |
执行端 |
权限节点 |
默认 |
/cmail 或 /cmail mail |
开启个人收件箱 GUI |
仅限玩家 |
cmail.use |
所有人 |
/cmail send <玩家 或 all 或 link_dc_player> <消息> |
撰写邮件并开启附件放置 GUI(all 发给全服、link_dc_player 发给所有已绑定 Discord 的玩家) |
仅限玩家 |
all / link_dc_player 需 cmail.admin / 普通为 cmail.use |
所有人 |
/cmail help |
显示指令说明清单 |
游戏内 / 控制台 |
cmail.use |
所有人 |
/cmail admin |
开启管理员审查菜单 |
仅限玩家 |
cmail.admin |
OP |
/cmail reload |
重新载入配置文件 |
游戏内 / 控制台 |
cmail.admin |
OP |
/cmail savepack <礼包名称> |
在游戏内打包道具为礼包模板 |
仅限玩家 |
cmail.admin |
OP |
/cmail sendpack <玩家1,玩家2,... 或 all 或 link_dc_player> <礼包名称> <消息> |
发送礼包模板给指定玩家、全服或所有已绑定 Discord 的玩家 |
游戏内 / 控制台 |
cmail.admin |
OP |
/cmail consolesend <玩家1,玩家2,... 或 link_dc_player> <消息> [材质:格位:数量]... |
通过纯指令发送特定排列的道具给多位玩家或所有已绑定 Discord 的玩家 |
游戏内 / 控制台 |
控制台无限制 / cmail.admin |
OP |
指令别名:/mail 等同于 /cmail。
收件者关键字:
all:服务器上所有曾加入过的玩家。
link_dc_player:所有已通过 DiscordLink 绑定 Discord 的玩家(需安装 DiscordLink,名单于发送当下读取)。
使用示例
1. 打包并发送自定义 NBT 道具
- 管理员将自定义道具放入快捷栏,在游戏内执行:
/cmail savepack cash_v1
- 将道具放入前 27 格,点击右下角储存并关闭。
- 于控制台或游戏内发送给指定玩家:
cmail sendpack playerA,playerB cash_v1 感谢赞助,这是您的礼包。
或是发送给全服所有玩家(需 cmail.admin 权限、OP 或控制台执行):
cmail sendpack all cash_v1 感谢大家的支持,这是全服补偿礼包!
2. 控制台直接发送基本道具
控制台发送 64 个钻石在第 4 格,16 个金锭在第 22 格给特定玩家:
cmail consolesend smart 这是您的活动奖励 DIAMOND:4:64 GOLD_INGOT:22:16
3. 寄给所有已绑定 Discord 的玩家
游戏内撰写并放入附件(需 cmail.admin):
/cmail send link_dc_player 感谢绑定 Discord,这是您的绑定奖励!
控制台发送礼包模板:
cmail sendpack link_dc_player cash_v1 感谢绑定 Discord,这是您的绑定奖励!
控制台直接发送道具:
cmail consolesend link_dc_player 绑定奖励 DIAMOND:0:5
- 若找不到 DiscordLink 数据库,会提示
link-dc-unavailable 消息并在控制台显示详细原因,邮件不会寄出。
- 若目前没有任何玩家绑定,会提示
link-dc-empty 消息。
- 寄出后,在线上的收件者会立即收到新邮件提示。
配置文件新增消息
以下消息可于 config.yml 的 messages 区块自定义(旧版配置文件若缺少这些字段,会自动使用插件内置的默认文字):
| 字段 |
说明 |
broadcast-sent |
全服邮件寄出成功 |
link-dc-sent |
寄给已绑定 Discord 玩家成功,%n% 为收件人数 |
link-dc-empty |
目前没有任何玩家绑定 Discord |
link-dc-unavailable |
无法读取 DiscordLink 绑定资料 |
Cmail
Cmail is a virtual mail and gift package plugin designed specifically for Paper (Minecraft 1.21.x+) servers. It utilizes a local SQLite database for persistent mail storage and seamlessly integrates with the Vault economy system. Featuring full NBT data preservation, it allows administrators to bundle items into gift packages and distribute them via batch console commands—ideal for reward distribution and automated webstore integrations.
Features
- 反作弊与安全机制:
- 如果玩家在“附件放置”或“包裹编辑”过程中意外断开连接、服务器重载,或库存 GUI 未正确关闭,所有物品将自动返回至玩家的背包。若背包已满,物品将在玩家所在位置自然掉落,从而防止物品丢失和复制漏洞。
- 只读 GUI 严格禁用 Shift+点击和拖拽操作,以防止误移除已附加的物品。
- NBT 包裹模板系统:
- 管理员可以在游戏中打开一个 36 格的 GUI,排列包含自定义 NBT 数据的物品(如自定义货币、带有自定义标签的物品或附魔武器),并将它们保存为可重复使用的模板。
- 支持通过游戏内命令或控制台命令,使用逗号分隔的玩家名称直接向多个玩家分发已保存的包裹模板。
- 控制台命令集成:
- 提供
consolesend 和 sendpack 命令,可通过服务器控制台、RCON 或外部脚本调用,以自动分发邮件和物品。
- 管理员检查与审计 GUI:
- 管理员可以审查整个服务器的邮件历史记录。内置的安全锁定机制要求在修改邮件内容、调整附件或永久删除邮件之前必须先解锁。
- Vault 经济支持:
- 可选择配置发送邮件的费用和附件费用,并在玩家撰写邮件时提供费用确认界面。
- 自定义发件人资料:
- 自动化邮件(如奖励包或行政邮件)的发件人显示名称可在
config.yml 中进行自定义,并支持颜色代码。
- 自动清理邮件:
- 根据配置的保留期限定期清除过期邮件,并提供选项以保留或清除未读邮件及带有未领取附件的邮件。
- DiscordLink 集成 (
link_dc_player):
- 指定
link_dc_player 作为收件人,可同时向所有绑定了 Discord 账号的玩家广播邮件。
- 收件人列表以只读模式从 DiscordLink 的 SQLite 数据库中实时读取,无需修改 DiscordLink 或启用其 HTTP API。
- 自动根据 DiscordLink 的
config.yml 中的 database.sqlite-file-name 设置检测数据库位置(默认为 plugins/DiscordLink/database.db)。
- 由
send、sendpack 和 consolesend 命令支持(均需要 cmail.admin 权限)。
命令与权限
该插件的主要命令是 /cmail。
| 命令 |
描述 |
执行者 |
权限节点 |
默认值 |
/cmail 或 /cmail mail |
打开个人邮箱 GUI |
仅限玩家 |
cmail.use |
所有人 |
/cmail send <player|all|link_dc_player> <message> |
撰写邮件并打开附件放置 GUI(all 发送给所有玩家,link_dc_player 发送给所有 Discord 绑定玩家) |
仅限玩家 |
all / link_dc_player 需要 cmail.admin / 标准:cmail.use |
所有人 |
/cmail help |
显示命令帮助列表 |
游戏内 / 控制台 |
cmail.use |
所有人 |
/cmail admin |
打开管理员检查 GUI |
仅限玩家 |
cmail.admin |
OP |
/cmail reload |
重新加载配置文件 |
游戏内 / 控制台 |
cmail.admin |
OP |
/cmail savepack <package_name> |
在游戏中将库存物品打包为礼物模板 |
仅限玩家 |
cmail.admin |
OP |
/cmail sendpack <player1,player2...|all|link_dc_player> <package_name> <message> |
将包裹模板发送给指定玩家、整个服务器或所有 Discord 绑定玩家 |
游戏内 / 控制台 |
cmail.admin |
OP |
/cmail consolesend <player1,player2...|link_dc_player> <message> [MATERIAL:SLOT:AMOUNT]... |
通过命令将特定槽位的物品发送给玩家 |
游戏内 / 控制台 |
控制台无限制 / cmail.admin |
OP |
命令别名:/mail 是 /cmail 的别名。
收件人关键词:
all: 所有曾经加入过服务器的玩家。
link_dc_player: 当前通过 DiscordLink 绑定的所有玩家(需要安装 DiscordLink;列表在执行时动态查询)。
使用示例
1. 打包并发送自定义 NBT 物品
- 将自定义物品放入快捷栏,然后在游戏内运行:
/cmail savepack cash_v1
- 将物品放入 GUI 的前 27 个格子中,然后点击右下角保存并退出。
- 通过控制台或游戏内发送给特定玩家:
cmail sendpack playerA,playerB cash_v1 Thank you for your support! Here is your reward package.
或者发送给整个服务器的所有玩家(需要 cmail.admin、OP 或控制台权限):
cmail sendpack all cash_v1 Thank you for your support, here is server-wide compensation!
2. 通过控制台直接分发物品
从控制台向特定玩家在第 4 槽位发送 64 个钻石,在第 22 槽位发送 16 个金锭:
cmail consolesend smart Event Reward DIAMOND:4:64 GOLD_INGOT:22:16
3. 发送给所有 Discord 绑定玩家
在游戏内撰写邮件并附加物品(需要 cmail.admin 权限):
/cmail send link_dc_player Thank you for linking your Discord! Here is your linking reward.
通过控制台发送包裹模板:
cmail sendpack link_dc_player cash_v1 Thank you for linking your Discord! Here is your linking reward.
通过控制台发送原始物品:
cmail consolesend link_dc_player Linking_Reward DIAMOND:0:5
- 如果无法定位 DiscordLink 数据库,将触发
link-dc-unavailable 消息并将详细信息记录到控制台;邮件不会发送。
- 如果没有玩家当前处于绑定状态,将出现
link-dc-empty 通知。
- 投递完成后,任何在线接收者都会收到新邮件的即时通知。
可配置的消息键
以下消息可在 config.yml 的 messages 部分进行配置(若缺少旧版配置,将回退至插件默认值):
| Key |
Description |
broadcast-sent |
邮件已成功广播至全服 |
link-dc-sent |
邮件已成功发送至与 Discord 绑定的玩家;%n% 代表接收者数量 |
link-dc-empty |
当前没有与 Discord 绑定的玩家 |
link-dc-unavailable |
无法加载 DiscordLink 数据库记录 |
Cmail
Cmail 是一款專為 Paper (Minecraft 1.21.x+) 伺服器設計的虛擬郵件與禮包系統。本插件採用 SQLite 本地資料庫儲存郵件數據,並支援 Vault 經濟系統。具備完整的 NBT 道具保存能力,可供管理員打包禮包並進行批次指令分發,適用於伺服器道具發放與自動化商城整合。
功能特性
- 安全防護機制:
- 當玩家在「放入附件」或「編輯禮包」時,若因異常斷線、伺服器重載或非正常關閉選單,系統會自動將所有道具退回玩家背包。若背包空間不足,則會自然掉落於玩家所在的世界座標,防止道具遺失或複製漏洞。
- 唯讀選單全面禁用 Shift-Click 與滑鼠拖曳限制,防止附件道具異常移出。
- NBT 禮包範本系統:
- 管理員可在遊戲內打開 36 格介面,將含有自訂 NBT 數據(如自訂金幣、特殊標籤道具、Lore 武器)擺放完成並進行打包。
- 支援通過主機或控制台指令(支援以逗號分隔多位玩家名稱)將打包好的禮包範本直接分發給多位玩家。
- 控制台指令整合:
- 提供
consolesend 與 sendpack 指令,可直接由控制台、RCON 或外部腳本調用以發送郵件與物品。
- 管理員後台審查:
- 管理員可調閱全伺服器所有歷史信件。內建安全鎖機制,解鎖後始可修改信件內文、調整信件附件,並支援在確認後永久刪除郵件。
- Vault 經濟整合:
- 可啟用發信手續費與附件手續費,並在玩家寄信時顯示扣款確認界面。
- 發信人自訂:
- 系統發送的信件(如禮包、後台信件)之發信人名稱可於
config.yml 中自由配置,支援色彩代碼。
- 自動清理機制:
- 定時自動清理過期郵件,可設定保留天數及是否清理未讀/含附件郵件。
- DiscordLink 整合 (
link_dc_player):
- 收件者填入
link_dc_player,即可一次寄信給所有已綁定 Discord 的玩家。
- 名單在發送當下直接從 DiscordLink 的 SQLite 資料庫以唯讀方式讀取,不需修改 DiscordLink,也不需開啟其 HTTP API。
- 資料庫位置會自動依照 DiscordLink 的
config.yml 中 database.sqlite-file-name 判斷 (預設 plugins/DiscordLink/database.db)。
- 支援
send、sendpack、consolesend 三個指令,皆需 cmail.admin 權限。
指令與權限
本插件主指令為 /cmail。
| 指令 |
說明 |
執行端 |
權限節點 |
預設 |
/cmail 或 /cmail mail |
開啟個人收件箱 GUI |
僅限玩家 |
cmail.use |
所有人 |
/cmail send <玩家 或 all 或 link_dc_player> <訊息> |
撰寫郵件並開啟附件放置 GUI(all 發給全服、link_dc_player 發給所有已綁定 Discord 的玩家) |
僅限玩家 |
all / link_dc_player 需 cmail.admin / 普通為 cmail.use |
所有人 |
/cmail help |
顯示指令說明清單 |
遊戲內 / 控制台 |
cmail.use |
所有人 |
/cmail admin |
開啟管理員審查選單 |
僅限玩家 |
cmail.admin |
OP |
/cmail reload |
重新載入設定檔 |
遊戲內 / 控制台 |
cmail.admin |
OP |
/cmail savepack <禮包名稱> |
在遊戲內打包道具為禮包範本 |
僅限玩家 |
cmail.admin |
OP |
/cmail sendpack <玩家1,玩家2,... 或 all 或 link_dc_player> <禮包名稱> <訊息> |
發送禮包範本給指定玩家、全服或所有已綁定 Discord 的玩家 |
遊戲內 / 控制台 |
cmail.admin |
OP |
/cmail consolesend <玩家1,玩家2,... 或 link_dc_player> <訊息> [材質:格位:數量]... |
透過純指令發送特定排列的道具給多位玩家或所有已綁定 Discord 的玩家 |
遊戲內 / 控制台 |
控制台無限制 / cmail.admin |
OP |
指令別名:/mail 等同 /cmail。
收件者關鍵字:
all:伺服器上所有曾加入過的玩家。
link_dc_player:所有已透過 DiscordLink 綁定 Discord 的玩家(需安裝 DiscordLink,名單於發送當下讀取)。
使用範例
1. 打包並發送自訂 NBT 道具
- 管理員將自訂道具放入快捷欄,在遊戲內執行:
/cmail savepack cash_v1
- 將道具放入前 27 格,點擊右下角儲存並關閉。
- 於控制台或遊戲內發送給指定玩家:
cmail sendpack playerA,playerB cash_v1 感謝贊助,這是您的禮包。
或是發送給全服所有玩家(需 cmail.admin 權限、OP 或控制台執行):
cmail sendpack all cash_v1 感謝大家的支持,這是全服補償禮包!
2. 控制台直接發送基本道具
控制台發送 64 個鑽石在第 4 格,16 個金錠在第 22 格給特定玩家:
cmail consolesend smart 這是您的活動獎勵 DIAMOND:4:64 GOLD_INGOT:22:16
3. 寄給所有已綁定 Discord 的玩家
遊戲內撰寫並放入附件(需 cmail.admin):
/cmail send link_dc_player 感謝綁定 Discord,這是您的綁定獎勵!
控制台發送禮包範本:
cmail sendpack link_dc_player cash_v1 感謝綁定 Discord,這是您的綁定獎勵!
控制台直接發送道具:
cmail consolesend link_dc_player 綁定獎勵 DIAMOND:0:5
- 若找不到 DiscordLink 資料庫,會提示
link-dc-unavailable 訊息並在控制台顯示詳細原因,郵件不會寄出。
- 若目前沒有任何玩家綁定,會提示
link-dc-empty 訊息。
- 寄出後,在線上的收件者會立即收到新郵件提示。
設定檔新增訊息
以下訊息可於 config.yml 的 messages 區塊自訂(舊版設定檔若缺少這些欄位,會自動使用插件內建的預設文字):
| 欄位 |
說明 |
broadcast-sent |
全服郵件寄出成功 |
link-dc-sent |
寄給已綁定 Discord 玩家成功,%n% 為收件人數 |
link-dc-empty |
目前沒有任何玩家綁定 Discord |
link-dc-unavailable |
無法讀取 DiscordLink 綁定資料 |
Cmail
Cmail is a virtual mail and gift package plugin designed specifically for Paper (Minecraft 1.21.x+) servers. It utilizes a local SQLite database for persistent mail storage and seamlessly integrates with the Vault economy system. Featuring full NBT data preservation, it allows administrators to bundle items into gift packages and distribute them via batch console commands—ideal for reward distribution and automated webstore integrations.
Features
- Anti-Exploit & Safety Mechanisms:
- If a player disconnects unexpectedly, the server reloads, or an inventory GUI closes improperly during "Attachment Placement" or "Package Editing," all items are automatically returned to the player's inventory. If the inventory is full, items drop naturally at the player's location, preventing item loss and duplication glitches.
- Read-only GUIs strictly disable Shift-Clicking and drag actions to prevent unintended removal of attached items.
- NBT Package Template System:
- Administrators can open a 36-slot GUI in-game, arrange items containing custom NBT data (such as custom currencies, items with custom tags, or lore weapons), and save them as reusable templates.
- Supports distributing saved package templates directly to multiple players using comma-separated player names via in-game or console commands.
- Console Command Integration:
- Offers
consolesend and sendpack commands that can be invoked via the server console, RCON, or external scripts to distribute mail and items automatically.
- Admin Inspection & Audit GUI:
- Administrators can review the entire server's mail history. A built-in security lock mechanism requires unlocking before modifying mail contents, adjusting attachments, or permanently deleting emails.
- Vault Economy Support:
- Optionally configure mail sending fees and attachment fees, complete with a fee confirmation interface when players compose mail.
- Custom Sender Profiles:
- The sender display name for automated mail (such as reward packages or administrative mail) can be customized in
config.yml with color code support.
- Automated Mail Cleanup:
- Periodically purges expired mail according to configured retention periods, with options to preserve or clear unread mail and mail with unclaimed attachments.
- DiscordLink Integration (
link_dc_player):
- Specify
link_dc_player as the recipient to broadcast mail to all players with linked Discord accounts simultaneously.
- The recipient list is read in real time from DiscordLink's SQLite database in read-only mode, requiring no modifications to DiscordLink or enabling its HTTP API.
- Automatically detects the database location based on the
database.sqlite-file-name setting in DiscordLink's config.yml (default: plugins/DiscordLink/database.db).
- Supported by
send, sendpack, and consolesend commands (all require the cmail.admin permission).
Commands & Permissions
The primary command for this plugin is /cmail.
| Command |
Description |
Executor |
Permission Node |
Default |
/cmail or /cmail mail |
Open personal mailbox GUI |
Player only |
cmail.use |
Everyone |
/cmail send <player|all|link_dc_player> <message> |
Compose mail and open attachment placement GUI (all for all players, link_dc_player for all Discord-linked players) |
Player only |
all / link_dc_player require cmail.admin / Standard: cmail.use |
Everyone |
/cmail help |
Display command help list |
In-game / Console |
cmail.use |
Everyone |
/cmail admin |
Open admin inspection GUI |
Player only |
cmail.admin |
OP |
/cmail reload |
Reload configuration files |
In-game / Console |
cmail.admin |
OP |
/cmail savepack <package_name> |
Package inventory items into a gift template in-game |
Player only |
cmail.admin |
OP |
/cmail sendpack <player1,player2...|all|link_dc_player> <package_name> <message> |
Send a package template to specified players, the entire server, or all Discord-linked players |
In-game / Console |
cmail.admin |
OP |
/cmail consolesend <player1,player2...|link_dc_player> <message> [MATERIAL:SLOT:AMOUNT]... |
Send specific items in designated slots to players via command |
In-game / Console |
Console unrestricted / cmail.admin |
OP |
Command Alias: /mail is an alias for /cmail.
Recipient Keywords:
all: All players who have ever joined the server.
link_dc_player: All players currently linked via DiscordLink (requires DiscordLink installed; list is queried dynamically upon execution).
Usage Examples
1. Packaging and Sending Custom NBT Items
- Place custom items into your hotbar, then run in-game:
/cmail savepack cash_v1
- Place the items into the first 27 slots of the GUI, then click the bottom-right corner to save and exit.
- Send to specific players via console or in-game:
cmail sendpack playerA,playerB cash_v1 Thank you for your support! Here is your reward package.
Or send to all players across the server (requires cmail.admin, OP, or console):
cmail sendpack all cash_v1 Thank you for your support, here is server-wide compensation!
2. Direct Item Distribution via Console
Send 64 diamonds to slot 4 and 16 gold ingots to slot 22 for a specific player from console:
cmail consolesend smart Event Reward DIAMOND:4:64 GOLD_INGOT:22:16
3. Sending to All Discord-Linked Players
Compose in-game and attach items (requires cmail.admin):
/cmail send link_dc_player Thank you for linking your Discord! Here is your linking reward.
Send a package template via console:
cmail sendpack link_dc_player cash_v1 Thank you for linking your Discord! Here is your linking reward.
Send raw items via console:
cmail consolesend link_dc_player Linking_Reward DIAMOND:0:5
- If the DiscordLink database cannot be located, a
link-dc-unavailable message will trigger and log details to the console; the mail will not be sent.
- If no players are currently linked, a
link-dc-empty notification will appear.
- Once delivered, any online recipients will receive an instant notification for new mail.
Configurable Message Keys
The following messages can be configured under the messages section of config.yml (legacy configurations will fall back to plugin defaults if missing):
| Key |
Description |
broadcast-sent |
Successfully broadcast mail to the entire server |
link-dc-sent |
Successfully sent mail to Discord-linked players; %n% represents the recipient count |
link-dc-empty |
No players are currently linked with Discord |
link-dc-unavailable |
Failed to load DiscordLink database records |
评论 0
登录后参与评分
还没有评论,来抢沙发吧