InventoryHistory - PaperMC 插件
一个适用于 PaperMC 1.21.1 的插件,用于追踪玩家物品栏历史记录,并允许管理员查看、恢复和复制物品栏快照。
功能
- 自动物品栏追踪:每 5 分钟为所有在线玩家保存一次物品栏快照
- 断开连接快照:在玩家登出时保存最终快照
- 历史记录查看:支持分页和可点击链接,可查看任意玩家的物品栏历史
- GUI 界面:交互式物品栏 GUI,用于浏览快照内容
- 物品栏恢复:从任何历史快照中恢复玩家的物品栏
- 物品复制:将快照中的物品复制到你的物品栏中
- 自动清理:超过 1 个月的快照会自动移除
- SQLite 数据库:轻量级、基于文件的存储——无需外部数据库
要求
- PaperMC 1.21.1 或更高版本
- Java 21 或更高版本
安装
- 下载 JAR 文件
- 将其放入服务器的
plugins 文件夹
- 启动服务器
- 插件会在
plugins/InventoryHistory/inventory_history.db 创建数据库
命令
| 命令 |
描述 |
权限 |
/invhist <player> [page] |
查看玩家的物品栏历史 |
inventoryhistory.view |
/invhist open <player> <id> |
在 GUI 中打开快照 |
inventoryhistory.view |
/invhist restore <player> <id> |
恢复玩家的物品栏 |
inventoryhistory.restore |
/invhist duplicate <player> <id> |
将物品复制到你的物品栏 |
inventoryhistory.duplicate |
/invhist cleanup |
删除旧快照 |
inventoryhistory.admin |
别名: /inventoryhistory, /invhist, /ih
权限
| 权限 |
描述 |
默认值 |
inventoryhistory.view |
查看物品栏历史 |
OP |
inventoryhistory.restore |
恢复物品栏 |
OP |
inventoryhistory.duplicate |
复制物品栏物品 |
OP |
inventoryhistory.admin |
完整管理员访问权限 |
OP |
使用示例
查看玩家的物品栏历史
/invhist Notch
/invhist Notch 2
显示带有可点击链接的分页列表,可查看、恢复或复制每个快照。
在 GUI 中打开快照
/invhist open Notch 123
打开一个交互式物品栏,显示所有物品、盔甲和副手槽位,并包含操作按钮。
恢复玩家的物品栏
/invhist restore Notch 123
将 Notch 的物品栏恢复到与快照 #123 完全一致的状态。玩家必须在线。
将物品复制到你的物品栏
/invhist duplicate Notch 123
将快照中的所有物品复制到你的物品栏中。溢出部分会掉落至地面。
清理旧快照
/invhist cleanup
手动删除超过 30 天的快照。
工作原理
- 每 5 分钟为在线玩家保存一次快照
- 玩家断开连接时会保存最终快照
- 每小时自动删除超过 30 天的快照
- 数据存储在 SQLite 数据库中,路径为
plugins/InventoryHistory/inventory_history.db
许可证
本插件按“原样”提供,仅供个人和服务器使用。
InventoryHistory - PaperMC Plugin
A PaperMC 1.21.1 plugin that tracks player inventory history and allows administrators to view, restore, and duplicate inventory snapshots.
Features
- Automatic Inventory Tracking: Saves inventory snapshots every 5 minutes for all online players
- Disconnect Snapshots: Saves a final snapshot when players log out
- History Viewing: View any player's inventory history with pagination and clickable links
- GUI Interface: Interactive inventory GUI to browse snapshot contents
- Inventory Restoration: Restore a player's inventory from any historical snapshot
- Item Duplication: Copy items from a snapshot to your own inventory
- Automatic Cleanup: Snapshots older than 1 month are automatically removed
- SQLite Database: Lightweight, file-based storage - no external database required
Requirements
- PaperMC 1.21.1 or later
- Java 21 or later
Installation
- Download the JAR file
- Place it in your server's
plugins folder
- Start the server
- The plugin creates a database at
plugins/InventoryHistory/inventory_history.db
Commands
| Command |
Description |
Permission |
/invhist <player> [page] |
View player's inventory history |
inventoryhistory.view |
/invhist open <player> <id> |
Open snapshot in GUI |
inventoryhistory.view |
/invhist restore <player> <id> |
Restore player's inventory |
inventoryhistory.restore |
/invhist duplicate <player> <id> |
Copy items to your inventory |
inventoryhistory.duplicate |
/invhist cleanup |
Delete old snapshots |
inventoryhistory.admin |
Aliases: /inventoryhistory, /invhist, /ih
Permissions
| Permission |
Description |
Default |
inventoryhistory.view |
View inventory history |
OP |
inventoryhistory.restore |
Restore inventories |
OP |
inventoryhistory.duplicate |
Duplicate inventory items |
OP |
inventoryhistory.admin |
Full admin access |
OP |
Usage Examples
View a player's inventory history
/invhist Notch
/invhist Notch 2
Shows a paginated list with clickable links to view, restore, or copy each snapshot.
Open a snapshot in GUI
/invhist open Notch 123
Opens an interactive inventory showing all items, armor, and off-hand slot with action buttons.
Restore a player's inventory
/invhist restore Notch 123
Restores Notch's inventory to exactly how it was in snapshot #123. Player must be online.
Copy items to your inventory
/invhist duplicate Notch 123
Copies all items from the snapshot to your inventory. Overflow drops on the ground.
Cleanup old snapshots
/invhist cleanup
Manually deletes snapshots older than 30 days.
How It Works
- Snapshots are saved every 5 minutes for online players
- A final snapshot is saved when players disconnect
- Snapshots older than 30 days are automatically deleted hourly
- Data is stored in SQLite at
plugins/InventoryHistory/inventory_history.db
License
This plugin is provided as-is for personal and server use.
评论 0
登录后参与评分
还没有评论,来抢沙发吧