BlockRollback
BlockRollback 是一款适用于 Paper、Spigot 和 Purpur 等 Bukkit 系 1.21.x 服务器的轻量级审计与回滚插件。
它将玩家操作、部分自然变化以及基于命令的编辑记录到 SQLite 数据库中,以便后续通过 inspect、lookup 和 rollback 命令进行检查、查询和回滚。
可以使用 /br 作为 /blockrollback 的别名。
主要功能
- 记录方块放置与破坏、桶的操作、爆炸、火焰、流体流动以及自然方块更新
- 记录容器物品交易和方块点击交互
- 记录方块放置与破坏、生物死亡、物品消失以及由
/fill 和 /kill 引起的变化
- 检查模式允许就地查看点击坐标的历史记录
- 支持按玩家名称、特殊标签、时间范围和半径搜索日志
- 支持回滚方块变化,以及恢复已死亡的生物和已消失的物品
- 使用本地 SQLite,无需外部数据库服务器
- 支持多语言消息
支持环境
- Bukkit 系 1.21.x
- 基于 Paper API 1.21.4
- Java 21
- Paper, Spigot, Purpur 及兼容加载器
命令
| 命令 |
描述 |
/br inspect [on|off] |
切换检查模式。开启时,点击方块将显示该方块位置的历史记录。 |
/br lookup <player|*|#Mobs|#DespawnItem> <time> [radius] [page] |
搜索符合给定条件的日志。time 可使用 30m、1h、1d、1w 和 1y 等格式。 |
/br rollback <player|*|#Mobs|#DespawnItem> <time> [radius] |
应用符合给定条件的可回滚记录。 |
/br tp <world> <x> <y> <z> |
从查找结果中传送到指定坐标。 |
/br cancel |
取消当前正在运行的回滚。 |
/br status |
显示数据库大小、日志数量、写入队列状态和回滚进度。 |
/br reload |
重新加载 config.yml、config.json 和语言文件。 |
/br help |
显示帮助信息。 |
示例
/br inspect on
/br lookup Steve 1h 20
/br lookup #TNT 1d
/br rollback Steve 30m 20
/br rollback #Mobs 15m 30
/br rollback #DespawnItem 10m 20
过滤器工作原理
- 玩家名称如
Steve 针对与该玩家相关的方块变化
* 针对范围内的所有可回滚记录
#Mobs 针对生物死亡记录
#DespawnItem 针对物品消失记录
- 也可以使用
#TNT、#Creeper、#Fire、#Fluid 和 #Natural 等特殊标签进行查找和回滚
记录内容
可回滚
- 方块放置与破坏
- 桶的放置与拾取
- 爆炸造成的破坏
- 火焰造成的燃烧
- 流体流动
- 自然方块变化
/fill 命令导致的方块变化
/kill 命令导致的生物死亡与移除
- 物品消失
仅审计
- 向容器中放入物品或从中取出物品
- 方块的左键和右键交互
权限
| 权限 |
描述 |
默认值 |
blockrollback.inspect |
切换检查模式 |
OP |
blockrollback.lookup |
运行查找并使用 /br tp |
OP |
blockrollback.rollback |
运行回滚并取消 |
OP |
blockrollback.admin |
运行状态检查和重载 |
OP |
配置
config.yml
主要设置:
| 键 |
描述 |
database-file |
SQLite 文件名 |
log.block-place-break |
记录方块放置与破坏 |
log.buckets |
记录桶的操作 |
log.container-transactions |
记录容器交易 |
log.item-despawn |
记录物品消失 |
log.mob-kill |
记录生物死亡 |
log.interactions |
记录方块点击 |
log.explosions |
记录爆炸 |
log.fire |
记录火焰造成的燃烧 |
log.fluid-flow |
记录流体流动 |
log.natural-block-updates |
记录自然方块更新 |
inspect.use-adjacent-when-holding-block |
手持方块右键时,检查相邻的目标位置 |
rollback.default-radius |
玩家省略半径时使用的默认半径 |
rollback.max-radius |
最大回滚半径 |
rollback.max-records-per-run |
单次回滚处理的最大记录数 |
rollback.apply-per-tick |
每刻应用的记录数 |
command-tracking.fill |
启用 /fill 追踪 |
command-tracking.fill-max-blocks |
/fill 追踪的最大方块数 |
command-tracking.kill |
启用 /kill 追踪 |
command-tracking.kill-max-entities |
/kill 追踪的最大实体数 |
command-tracking.console-world |
控制台发出的命令所使用的世界名称 |
command-tracking.notify-skip |
当目标过大导致追踪被跳过时发送通知 |
config.json
config.json 用于配置语言。
{
"configVersion": 1,
"language": "en_us "
}
支持的语言:
ja_jp
en_us
de_de
fr_fr
ru_ru
zh_cn
首次启动时的默认值为 en_us。
您也可以编辑 plugins/BlockRollback/lang/ 中生成的 .lang 文件来创建自己的翻译。
行为说明
- 同一时间只能运行一个回滚任务
- 对于
lookup 和 rollback,如果是玩家执行,半径过滤将使用执行者当前位置
- 无法从控制台使用基于半径的
lookup
- 当检查模式启用时,正常的方块交互会被取消,以便点击可用于审计显示
- 如果目标世界不存在或目标实体已经存在,则跳过该记录
存储数据
- 日志以 SQLite 形式存储在
plugins/BlockRollback/<database-file> 中
- 表名为
action_logs
- 为时间、玩家名称加时间以及位置创建了索引
BlockRollback
BlockRollback is a lightweight audit and rollback plugin for Bukkit-family 1.21.x servers such as Paper, Spigot, and Purpur.
It records player actions, some natural changes, and command-based edits into SQLite so they can later be inspected, looked up, and rolled back with inspect, lookup, and rollback.
You can use /br as an alias for /blockrollback.
Main Features
- Records block placement and breaking, bucket actions, explosions, fire, fluid flow, and natural block updates
- Records container item transactions and block click interactions
- Records block placement and breaking, mob deaths, item despawns, and changes caused by
/fill and /kill
- Inspect mode lets you check the history of the clicked coordinates in place
- Search logs by player name, special tags, time range, and radius
- Supports rolling back block changes as well as restoring killed mobs and despawned items
- Uses SQLite locally, so no external database server is required
- Supports multilingual messages
Supported Environment
- Bukkit-family 1.21.x
- Based on the Paper API 1.21.4
- Java 21
- Paper, Spigot, Purpur, and compatible loaders
Commands
| Command |
Description |
/br inspect [on|off] |
Toggles Inspect mode. While it is on, clicking a block shows the history of that block position. |
/br lookup <player|*|#Mobs|#DespawnItem> <time> [radius] [page] |
Searches logs that match the given conditions. time uses formats such as 30m, 1h, 1d, 1w, and 1y. |
/br rollback <player|*|#Mobs|#DespawnItem> <time> [radius] |
Applies rollbackable records that match the given conditions. |
/br tp <world> <x> <y> <z> |
Teleports you to the coordinates from a lookup result. |
/br cancel |
Cancels the currently running rollback. |
/br status |
Shows database size, log count, write queue status, and rollback progress. |
/br reload |
Reloads config.yml, config.json, and language files. |
/br help |
Shows help. |
Examples
/br inspect on
/br lookup Steve 1h 20
/br lookup #TNT 1d
/br rollback Steve 30m 20
/br rollback #Mobs 15m 30
/br rollback #DespawnItem 10m 20
How Filters Work
- A player name such as
Steve targets block-related changes associated with that player
* targets every rollbackable record within the scope
#Mobs targets mob death records
#DespawnItem targets item despawn records
- Special tags such as
#TNT, #Creeper, #Fire, #Fluid, and #Natural can also be used for lookup and rollback
What Gets Logged
Rollbackable
- Block placement and breaking
- Bucket placement and pickup
- Destruction caused by explosions
- Burning caused by fire
- Fluid flow
- Natural block changes
- Block changes caused by
/fill
- Mob deaths and mob removals caused by
/kill
- Item despawns
Audit Only
- Putting items into containers and taking items out
- Left-click and right-click interactions on blocks
Permissions
| Permission |
Description |
Default |
blockrollback.inspect |
Toggle Inspect mode |
OP |
blockrollback.lookup |
Run lookup and use /br tp |
OP |
blockrollback.rollback |
Run rollback and cancel |
OP |
blockrollback.admin |
Run status and reload |
OP |
Configuration
config.yml
Main settings:
| Key |
Description |
database-file |
SQLite file name |
log.block-place-break |
Log block placement and breaking |
log.buckets |
Log bucket actions |
log.container-transactions |
Log container transactions |
log.item-despawn |
Log item despawns |
log.mob-kill |
Log mob deaths |
log.interactions |
Log block clicks |
log.explosions |
Log explosions |
log.fire |
Log burning caused by fire |
log.fluid-flow |
Log fluid flow |
log.natural-block-updates |
Log natural block updates |
inspect.use-adjacent-when-holding-block |
When holding a block and right-clicking, inspect the adjacent target position |
rollback.default-radius |
Default radius used when a player omits the radius |
rollback.max-radius |
Maximum rollback radius |
rollback.max-records-per-run |
Maximum records processed in one rollback run |
rollback.apply-per-tick |
Number of records applied per tick |
command-tracking.fill |
Enable /fill tracking |
command-tracking.fill-max-blocks |
Maximum number of blocks tracked for /fill |
command-tracking.kill |
Enable /kill tracking |
command-tracking.kill-max-entities |
Maximum number of entities tracked for /kill |
command-tracking.console-world |
World name used for console-issued commands |
command-tracking.notify-skip |
Notify when tracking is skipped because the target is too large |
config.json
config.json is used to configure the language.
{
"configVersion": 1,
"language": "en_us "
}
Supported languages:
ja_jp
en_us
de_de
fr_fr
ru_ru
zh_cn
The default value on first launch is en_us.
You can also edit the .lang files generated in plugins/BlockRollback/lang/ to create your own translation.
Behavior Notes
- Only one rollback can run at a time
- For
lookup and rollback, radius filtering uses the executor's current position when run by a player
- Radius-based
lookup cannot be used from the console
- While Inspect mode is enabled, normal block interaction is cancelled so the click can be used for audit display
- A record is skipped if the destination world does not exist or if the target entity is already present
Stored Data
- Logs are stored as SQLite in
plugins/BlockRollback/<database-file>
- The table name is
action_logs
- Indexes are created for time, player name plus time, and location
评论 0
登录后参与评分
还没有评论,来抢沙发吧