? DataLens
Minecraft 的实时数据检查器——检查、编辑、比较和导出任意方块、实体或物品。

概览
DataLens 是一款 Paper 插件,为服务器管理员和开发者提供了一扇深入 Minecraft 对象内部数据结构的强力窗口。指向任意方块、实体或玩家,即可通过 分页箱子 GUI 和 聊天命令 即时探索其完整的数据树——包括 PDC 标签、属性、药水效果、附魔、方块状态等。
与简单的 NBT 查看器不同,DataLens 提供了完整的 检查 → 编辑 → 验证 → 差异比较 → 导出 流程,具备失败时自动回滚、内置更改日志以及用于第三方模式注册的公共 API。
支持的平台: Bukkit / Spigot / Paper 1.20.x – 21.x · Java 21+
功能
? 深度检查
- 方块、实体、物品与玩家 —— 通过射线追踪瞄准或直接输入玩家名称来检查任意对象。
- 完整数据树提取 —— PDC 键、方块状态、实体属性、药水效果、装备、附魔、描述 Lore 等被捕获并构建成层级化的
DataNode 树。
- 版本自适应 —— 可插拔的适配层自动检测服务器版本并加载相应的读取器/写入器。
✏️ 安全的就地编辑
- 设置 / 移除 任何基本类型的值,使用点表示法路径(例如
pdc.myplugin:level)。
- 类型验证与强制转换 —— 在提交之前,原始字符串输入会根据目标节点的
DataType 进行验证。
- 原子回滚 —— 每次写入前都会创建深层复制快照;如果持久化失败,将自动恢复数据树。
? 差异引擎
- 将 实时 数据树与你的 工作副本 进行比较,以精确查看发生了哪些更改——新增、删除和修改将以颜色编码的聊天输出形式显示。
? 导出
- 将完整的数据树以 JSON 或 YAML 格式直接转储到聊天栏。
?️ 检查器 GUI
- 带有导航面包屑的 54 格分页库存界面。
- 点击复合/列表节点可深入查看;使用 Back 向上导航。
- 颜色编码的类型指示器、分页控件以及一键导出功能。
? 更改日志
- 每个
SET 和 REMOVE 操作都会记录到 plugins/DataLens/changelog.log 中,包含时间戳、操作者、路径以及旧/新值。
- 可配置 —— 可以完全禁用。
? 权限系统
- 细粒度的权限节点 (
datalens.inspect, datalens.edit, datalens.admin)。
? 公共 API
- 第三方插件可以为其 PDC 命名空间注册 schemas(模式),以改进标签和验证。
- 通过
DataLensPlugin.getAPI() 以编程方式访问 InspectorService 和 SessionService。
⚡ 性能
- 基于 Caffeine LRU 缓存的逐玩家会话,具有可配置的 TTL(生存时间)和容量。
- 读取操作是线程安全的;写入操作强制执行主线程执行。
命令
| 命令 |
描述 |
权限 |
/inspect |
检查你正在注视的方块/实体(射线追踪) |
datalens.inspect |
/inspect <player> |
直接检查指定名称的在线玩家 |
datalens.inspect |
/data set <path> <value> |
编辑给定路径上的基本类型值 |
datalens.edit |
/data remove <path> |
删除给定路径上的节点 |
datalens.edit |
/data export [json|yaml] |
将检查的数据树导出到聊天栏 |
datalens.inspect |
/data diff |
显示实时数据与工作副本之间的差异 |
datalens.inspect |
所有命令均包含 上下文感知的 Tab 补全 —— 路径会从实时数据树中自动补全,而值会提示符合类型的选项。
权限
| 节点 |
描述 |
默认值 |
datalens.inspect |
检查方块、实体和物品 |
op |
datalens.edit |
编辑检查的数据值 |
op |
datalens.admin |
完全管理访问权限(继承 inspect + edit) |
op |
配置
配置存储在 plugins/DataLens/config.yml 中:
debug: false
cache:
session-ttl-seconds: 60 # 玩家会话的空闲超时时间
max-sessions: 100 # 最大并发检查会话数
inspect:
max-ray-distance: 5.0 # /inspect 的射线追踪距离(以方块为单位)
changelog:
enabled: true # 启用/禁用编辑日志记录
max-entries: 10000 # 最大更改日志条目数
? 文档与支持
所有文档、源代码和示例均可在官方仓库中找到:
?
? DataLens
Real-time data inspector for Minecraft — inspect, edit, compare and export any block, entity or item.

Overview
DataLens is a Paper plugin that gives server operators and developers a powerful lens into the internal data structures of Minecraft objects. Point at any block, entity or player, and instantly explore its full data tree — PDC tags, attributes, potion effects, enchantments, block states and more — through both a paginated chest GUI and chat commands.
Unlike simple NBT viewers, DataLens provides a complete inspect → edit → validate → diff → export pipeline with automatic rollback on failure, a built-in changelog, and a public API for third-party schema registration.
Supported platforms: Bukkit / Spigot / Paper 1.20.x – 1.21.x · Java 21+
Features
? Deep Inspection
- Blocks, Entities, Items & Players — inspect any object via raytrace targeting or by player name.
- Full data tree extraction — PDC keys, block states, entity attributes, potion effects, equipment, enchantments, lore, and more are captured into a hierarchical
DataNode tree.
- Version-adaptive — pluggable adapter layer auto-detects the server version and loads the appropriate reader/writer.
✏️ Safe In-Place Editing
- Set / Remove any primitive value by dot-notation path (e.g.
pdc.myplugin:level).
- Type validation & coercion — raw string inputs are validated against the target node's
DataType before committing.
- Atomic rollback — a deep-copy snapshot is taken before every write; if persistence fails the tree is restored automatically.
? Diff Engine
- Compare the live data tree against your working copy to see exactly what changed — additions, removals and modifications are displayed with color-coded chat output.
? Export
- Dump the complete data tree as JSON or YAML directly to chat.
?️ Inspector GUI
- 54-slot paginated inventory with navigation breadcrumbs.
- Click into compound/list nodes to drill down; use Back to navigate up.
- Color-coded type indicators, pagination controls, and one-click export.
? Changelog
- Every
SET and REMOVE operation is logged to plugins/DataLens/changelog.log with timestamps, actor, path, and old/new values.
- Configurable — can be disabled entirely.
? Permission System
- Granular permission nodes (
datalens.inspect, datalens.edit, datalens.admin).
? Public API
- Third-party plugins can register schemas for their PDC namespaces to improve labelling and validation.
- Programmatic access to
InspectorService and SessionService via DataLensPlugin.getAPI().
⚡ Performance
- Per-player sessions backed by a Caffeine LRU cache with configurable TTL and capacity.
- Read operations are thread-safe; writes enforce main-thread execution.
Commands
| Command |
Description |
Permission |
/inspect |
Inspect the block/entity you are looking at (raytrace) |
datalens.inspect |
/inspect <player> |
Inspect a named online player directly |
datalens.inspect |
/data set <path> <value> |
Edit a primitive value at the given path |
datalens.edit |
/data remove <path> |
Delete the node at the given path |
datalens.edit |
/data export [json|yaml] |
Export the inspected data tree to chat |
datalens.inspect |
/data diff |
Show differences between live data and working copy |
datalens.inspect |
Both commands include context-aware tab completion — paths are autocompleted from the live data tree, and values suggest type-appropriate options.
Permissions
| Node |
Description |
Default |
datalens.inspect |
Inspect blocks, entities and items |
op |
datalens.edit |
Edit inspected data values |
op |
datalens.admin |
Full administrative access (inherits inspect + edit) |
op |
Configuration
Configuration is stored in plugins/DataLens/config.yml:
debug: false
cache:
session-ttl-seconds: 60 # Idle timeout for player sessions
max-sessions: 100 # Maximum concurrent inspection sessions
inspect:
max-ray-distance: 5.0 # Raytrace distance in blocks for /inspect
changelog:
enabled: true # Enable/disable edit logging
max-entries: 10000 # Maximum changelog entries
? Documentation and support
All documentation, source code, and examples are available in the official repository:
?
评论 0
登录后参与评分
还没有评论,来抢沙发吧