DeathLog - 死亡历史与物品恢复
适用于 Paper/Spigot 服务器的轻量级死亡历史与物品恢复插件,支持 SQL 数据库存储。
DeathLog 是一款适用于 Paper/Spigot 的管理员插件,它将玩家的死亡历史直接存储在数据库中,通过便捷的图形用户界面(GUI)显示丢失的物品,并允许工作人员安全地恢复丢失的物品。
与不断读取和重写大型 YAML 文件不同,每次死亡都作为独立的数据库记录存储。这提供了更好的性能、更快的死亡历史访问速度,并使 DeathLog 适合拥有大量死亡历史的服务器。
?️ 数据库存储
DeathLog 支持:
- SQLite — 默认
- MySQL
- MariaDB
- PostgreSQL
数据库操作使用连接池并以异步方式执行,从而将 SQL 查询与 Minecraft 主线程隔离。
在首次启动时,现有的 YAML 死亡数据可以自动迁移到数据库中。原始的 YAML 文件会被备份,且不会自动删除。
✨ 功能特性
-
SQL 数据库存储
-
支持 SQLite、MySQL、MariaDB 和 PostgreSQL
-
异步数据库操作
-
使用 HikariCP 进行连接池管理
-
用于死亡历史的 SQL 分页
-
自动 YAML → SQL 迁移
-
自动迁移备份
-
使用 PlayerDeathEvent 记录玩家死亡
-
死亡历史 GUI
-
查看每次死亡的丢失物品
-
完整保存 ItemStack:
- 元数据 (meta)
- NBT 标签
- 附魔
- 描述 (lore)
- 自定义物品数据
-
保存以下信息:
- 世界
- 坐标
- 死亡时间
- 偏航角/俯仰角 (yaw/pitch)
-
检测以下内容:
-
传送工作人员至死亡地点
-
通过 GUI 直接恢复物品
-
恢复前检查背包空位
-
一次性恢复保护
-
记录执行恢复操作的管理员
-
恢复后移除追踪的世界掉落物
-
移除其他玩家拾取的他人死亡掉落物
-
移除已装备的被盗物品,包括:
-
移除由死亡掉落物放置的方块
-
尝试在死亡地点回滚方块
-
每个玩家可配置的最大死亡记录数,采用 FIFO(先进先出)清理机制
-
玩家退出保存系统
-
支持待处理恢复
-
支持 EN/RU 语言
-
可配置的前缀和核心设置
? 命令
/deathlog
打开你的死亡历史。
/deathlog <player>
打开其他玩家的死亡历史。
/deathlog clear
清除你的死亡历史。
/deathlog clear <player>
清除其他玩家的死亡历史。
/deathlog nosave <deathId>
由退出保存按钮使用,用于移除已保存的死亡记录。
? 权限
默认情况下,只有 OP 拥有访问权限。
deathlog.view
访问自己的历史记录。
deathlog.others
查看和管理其他玩家的历史记录。
deathlog.restore
恢复物品。
♻️ 恢复
恢复前
- 如果配置要求,玩家必须在线
- 会检查背包剩余空间
- 死亡记录尚未被恢复
- 死亡数据直接从数据库加载
恢复后
-
物品返还给死亡玩家
-
如果有空位,护甲将恢复到护甲槽
-
如果有空位,副手物品将恢复到副手槽
-
如果有空位,背包物品将恢复到原始槽位
-
被占用的槽位会回退到可用的背包空间
-
追踪的掉落物将从世界中移除
-
其他玩家拾取的物品将被移除
-
已装备的被盗物品将从以下位置移除:
-
由死亡掉落物放置的方块将被移除
-
记录执行恢复操作的管理员
如果恢复操作失败,死亡记录不会被移除,以防止意外数据丢失。
? 死亡保存
死亡后,玩家会收到一条聊天消息:
Death info saved for staff. [Do not save]
行为
[Do not save]
死亡记录将从数据库中删除,并对工作人员隐藏。
⚙️ 配置
文件路径:
plugins/DeathLog/config.yml
language: "en"
prefix: "&8[&cDeathLog&8] &7"
database:
type: SQLITE
host: localhost
port: 3306
database: deathlog
username: root
password: ""
ssl: false
file: deaths.db
pool-size: 10
storage:
max_deaths_per_player: 10
date_format: "dd.MM.yyyy HH:mm:ss"
auto_save_on_death: true
allow_player_opt_out: true
restore:
require_player_online: true
check_inventory_space: true
one_time_restore: true
remove_world_drops: true
remove_picked_items: true
remove_picked_items_on_join: true
remove_placed_blocks: true
block_rollback: true
notify_target: true
tracking:
dropped_item_search_radius: 4.0
track_picked_items: true
track_placed_blocks: true
gui:
history_size: 54
details_size: 54
teleport_slot: 45
restore_slot: 49
back_slot: 53
?️ 数据库
DeathLog 创建以下主要表:
players
存储玩家信息:
- 内部 ID
- UUID
- 用户名
- 首次出现时间
- 最后出现时间
deaths
存储单独的死亡记录:
- 死亡 ID
- 玩家 ID
- 死亡时间
- 世界
- 坐标
- 死亡原因
- 击杀者信息
- 经验值
- 背包内容
- 护甲
- 副手物品
- 原始槽位
- 回滚数据
- 追踪的掉落物
- 已拾取物品
- 已放置方块
- 恢复状态
- 待处理恢复数据
索引用于玩家 UUID、玩家死亡历史、死亡时间以及 (player_id, death_time) 查询。
死亡历史使用 SQL 分页加载,而不是将整个数据库加载到内存中。
? YAML 迁移
如果 DeathLog 检测到现有的 YAML 死亡文件,它会自动将数据迁移到 SQL。
迁移过程:
- 创建数据库表
- 导入现有的死亡记录
- 保留所有受支持的死亡数据
- 检查已导入的记录数量
- 防止重复导入
- 存储迁移版本信息
- 创建原始 YAML 文件的备份
- 不会自动删除旧的 YAML 文件
这使得现有服务器可以在无需手动转换死亡历史的情况下进行升级。
? 语言
默认语言:
English
可用语言
en — English
ru — Русский
语言文件
plugins/DeathLog/lang/en.yml
plugins/DeathLog/lang/ru.yml
俄语配置
language: "ru"
更改语言后,请重启服务器。
? 安装
1. 下载
DeathLog.jar
2. 移动
将 jar 文件放入以下目录:
plugins/
3. 重启
启动或重启你的服务器。
4. 配置
编辑:
plugins/DeathLog/config.yml
选择你的数据库类型,如果使用的是 MySQL、MariaDB 或 PostgreSQL,请配置连接信息。
? 兼容性
Minecraft: 1.20+ / 1.21+
Platform: Paper / Spigot
Java: 17+
DeathLog 不需要 Java 21+ 或仅依赖 Paper API。
? 使用场景
DeathLog 适用于:
- 生存服务器
- 防破坏(Grief)控制系统
- 管理员工具服务器
- 硬核玩法
- 行政管理与审核
- 拥有大量死亡历史的服务器
- 任何需要快速且安全物品恢复工具的管理员服务器
❤️ DeathLog
简单。安全。快速。基于数据库的死亡物品恢复。
DeathLog - Death History & Item Recovery
Lightweight death history and item recovery plugin for Paper/Spigot servers with SQL database storage.
DeathLog is a lightweight admin plugin for Paper/Spigot that stores player death history directly in a database, displays lost items through a convenient GUI, and allows staff to safely restore lost items.
Instead of constantly reading and rewriting large YAML files, each death is stored as an individual database record. This provides better performance, faster death history access, and makes DeathLog suitable for servers with large amounts of death history.
?️ Database Storage
DeathLog supports:
- SQLite — default
- MySQL
- MariaDB
- PostgreSQL
Database operations use a connection pool and are executed asynchronously, keeping SQL queries away from the Minecraft main thread.
Existing YAML death data can be automatically migrated to the database on the first launch. Original YAML files are backed up and are not automatically deleted.
✨ Features
-
SQL database storage
-
SQLite, MySQL, MariaDB and PostgreSQL support
-
Asynchronous database operations
-
Connection pooling with HikariCP
-
SQL pagination for death history
-
Automatic YAML → SQL migration
-
Automatic migration backup
-
Logs player deaths using PlayerDeathEvent
-
Death history GUI
-
View lost items for each death
-
Full ItemStack saving:
- meta
- NBT
- enchantments
- lore
- custom item data
-
Saves:
- world
- coordinates
- death time
- yaw/pitch
-
Detects:
- death cause
- killer
- player / mob / projectile
-
Teleport staff to death locations
-
Restore items directly through GUI
-
Inventory free-space check before restore
-
One-time restore protection
-
Logs the administrator who restored items
-
Removes tracked world drops after restore
-
Removes items from players who picked up someone else's death loot
-
Removes equipped stolen items from:
-
Removes placed blocks created from death loot
-
Attempts block rollback at death location
-
Configurable death limit per player with FIFO cleanup
-
Player opt-out system for death saving
-
Pending restore support
-
EN/RU language support
-
Configurable prefix and core settings
? Commands
/deathlog
Open your death history.
/deathlog <player>
Open another player's death history.
/deathlog clear
Clear your death history.
/deathlog clear <player>
Clear another player's death history.
/deathlog nosave <deathId>
Used by the opt-out button to remove a saved death.
? Permissions
By default, only OP has access.
deathlog.view
Access your own history.
deathlog.others
View and manage other players' histories.
deathlog.restore
Restore items.
♻️ Restore
Before Restore
- Player must be online when required by configuration
- Free inventory space is checked
- Death must not already be restored
- Death data is loaded directly from the database
After Restore
-
Items are returned to the dead player
-
Armor is restored to armor slots if available
-
Offhand items are restored to the offhand slot if free
-
Inventory items return to original slots if available
-
Occupied slots fallback to free inventory space
-
Tracked drops are removed from the world
-
Picked-up items are removed from other players
-
Equipped stolen items are removed from:
-
Blocks placed from death loot are removed
-
Restore administrator is logged
If a restore operation fails, the death record is not removed, preventing accidental data loss.
? Death Saving
After death, the player receives a chat message:
Death info saved for staff. [Do not save]
Behavior
[Do not save]
the death record is deleted from the database and hidden from staff.
⚙️ Config
File:
plugins/DeathLog/config.yml
language: "en"
prefix: "&8[&cDeathLog&8] &7"
database:
type: SQLITE
host: localhost
port: 3306
database: deathlog
username: root
password: ""
ssl: false
file: deaths.db
pool-size: 10
storage:
max_deaths_per_player: 10
date_format: "dd.MM.yyyy HH:mm:ss"
auto_save_on_death: true
allow_player_opt_out: true
restore:
require_player_online: true
check_inventory_space: true
one_time_restore: true
remove_world_drops: true
remove_picked_items: true
remove_picked_items_on_join: true
remove_placed_blocks: true
block_rollback: true
notify_target: true
tracking:
dropped_item_search_radius: 4.0
track_picked_items: true
track_placed_blocks: true
gui:
history_size: 54
details_size: 54
teleport_slot: 45
restore_slot: 49
back_slot: 53
?️ Database
DeathLog creates the following main tables:
players
Stores player information:
- internal ID
- UUID
- username
- first seen
- last seen
deaths
Stores individual death records:
- death ID
- player ID
- death time
- world
- coordinates
- death cause
- killer information
- experience
- inventory
- armor
- offhand
- original slots
- rollback data
- tracked drops
- picked items
- placed blocks
- restore status
- pending restore data
Indexes are used for player UUIDs, player death history, death time, and (player_id, death_time) queries.
Death history is loaded using SQL pagination instead of loading the entire database into memory.
? YAML Migration
If DeathLog detects an existing YAML death file, it automatically migrates the data to SQL.
The migration:
- Creates the database tables
- Imports existing deaths
- Preserves all supported death data
- Checks the number of imported records
- Prevents duplicate imports
- Stores the migration version
- Creates a backup of the original YAML
- Does not automatically delete the old YAML
This allows existing servers to upgrade without manually converting their death history.
? Languages
Default language:
English
Available Languages
en — English
ru — Русский
Language Files
plugins/DeathLog/lang/en.yml
plugins/DeathLog/lang/ru.yml
Russian Language
language: "ru"
After changing the language, restart the server.
? Installation
1. Download
DeathLog.jar
2. Move
Place the jar into:
plugins/
3. Restart
Start or restart your server.
4. Configure
Edit:
plugins/DeathLog/config.yml
Choose your database type and configure the connection if you are using MySQL, MariaDB, or PostgreSQL.
? Compatibility
Minecraft: 1.20+ / 1.21+
Platform: Paper / Spigot
Java: 17+
DeathLog does not require Java 21+ or Paper-only APIs.
? Use Cases
DeathLog is useful for:
- Survival servers
- Grief-control systems
- Staff utility servers
- Hardcore gameplay
- Administrative moderation
- Large servers with extensive death histories
- Any server where staff need fast and safe item recovery tools
❤️ DeathLog
Simple. Safe. Fast. Database-powered death recovery.
评论 0
登录后参与评分
还没有评论,来抢沙发吧