Ez-RankView
一个 LuckPerms 插件,让管理员在测试权限时切换排名变得前所未有的简单,适用于 Purpur / Paper 1.21.x。它允许员工在不永久更改任何人权限的情况下预览排名 —— 非常适合查看新排名的外观,或在玩家之间切换排名以进行比较。
预览效果:
- 将目标组的解析前缀/后缀复制到玩家身上,使聊天标签实际可见,并且
- (可选)在预览活动期间授予该组的权限。
它是纯添加性的 —— 玩家的现有组和节点永远不会被触碰。所有添加的节点都会在预览停止时被移除。临时节点还带有过期时间(可配置),以便服务器崩溃后能自动清理。
目录
要求
| 项目 |
版本 |
| 服务器 |
Purpur / Paper 1.21.x |
| Java |
21+ |
| LuckPerms |
已安装并运行(任何 5.x 版本) |
构建
包含 Maven 包装器,因此您无需安装 Maven:
./mvnw clean package
编译后的插件位于 target/Ez-RankView-1.0.0.jar。
安装
- 构建插件(或获取发布版 jar)。
- 将
Ez-RankView-<version>.jar 放入服务器的 plugins/ 文件夹中。
- 重启服务器。必须安装 LuckPerms。
- 在游戏中运行
/rankview list 以确认组已被检测。
命令
基础命令:/rankview(别名:/rv, /rankpreview)。
| 命令 |
功能 |
/rankview <group> |
对自己预览 <group>。再次运行则停止。 |
/rankview <group> <player> |
对其他玩家预览 <group>。 |
/rankview stop [player] |
停止预览(自己或指定玩家)。 |
/rankview list |
列出 LuckPerms 组和当前活动的预览。 |
/rankview reload |
重新加载 config.yml。 |
如果已有活动预览,预览不同组会自动切换到新组。
权限
| 权限 |
默认值 |
允许的操作 |
ezrankview.use |
op |
对自己预览排名、列出组。 |
ezrankview.others |
op |
为其他玩家应用/清除预览。 |
ezrankview.reload |
op |
重新加载配置。 |
ezrankview.admin |
op |
授予以上所有权限。 |
配置 (config.yml)
preview:
apply-permissions: true # 同时预览组的权限
apply-chat-meta: true # 复制组的前缀/后缀以使标签显示
priority-offset: 1000 # 优先级提升,使预览超越真实前缀
expire-after-seconds: 3600 # 临时节点的崩溃安全过期时间(0 = 直到停止)
restore-on-quit: true # 玩家登出时清除预览
所有消息均可在 messages: 下编辑,支持 & 颜色代码以及以下占位符:%group%、%player%、%prefix%、%error%。
工作原理
底层使用 LuckPerms API。当预览开始时:
- 从缓存的元数据中读取目标组的解析前缀/后缀,
- 在更高优先级下向玩家添加匹配的
prefix/suffix 节点,
- (可选)添加临时的
group.<name> 继承节点以获取权限,并且
- 记住它添加的确切节点。
停止预览会精确移除这些节点。玩家的数据没有其他改变,restore-on-quit 加上节点过期使得残留预览几乎不可能发生。
备注
- 预览是添加性的,因此玩家在预览期间保留其真实权限(预览排名的权限叠加在上面)。这使得它在活跃玩家身上使用非常安全。
- 插件仅理解 LuckPerms 本身解析的内容。如果您的聊天/标签页/名称标签格式化由其他插件处理,只要该插件读取 LuckPerms 前缀(大多数都如此),它就会显示预览。
许可证
根据 MIT 许可证 发布。
Ez-RankView
A LuckPerms addon which makes switching ranks easier than ever for admins testing out
permissions, for Purpur / Paper 1.21.x. It lets staff preview a rank without permanently
changing anyone's permissions — perfect for checking how a new rank will look, or for
switching a player between ranks to compare them.
A preview:
- copies the target group's resolved prefix / suffix onto the player so the chat tag is
actually visible, and
- (optionally) grants the group's permissions while the preview is active.
It is purely additive — the player's existing groups and nodes are never touched. Every
node that is added is removed again when the preview stops. Temporary nodes also carry an
expiry (configurable) so a crashed server cleans up after itself.
Table of contents
Requirements
| Thing |
Version |
| Server |
Purpur / Paper 1.21.x |
| Java |
21+ |
| LuckPerms |
installed and running (any 5.x) |
Building
A Maven wrapper is included, so you don't need Maven installed:
./mvnw clean package
The compiled plugin lands in target/Ez-RankView-1.0.0.jar.
Installation
- Build the plugin (or grab a release jar).
- Drop
Ez-RankView-<version>.jar into your server's plugins/ folder.
- Restart the server. LuckPerms must be installed.
- Run
/rankview list in-game to confirm the groups are detected.
Commands
Base command: /rankview (aliases: /rv, /rankpreview).
| Command |
What it does |
/rankview <group> |
Preview <group> on yourself. Run it again to stop. |
/rankview <group> <player> |
Preview <group> for another player. |
/rankview stop [player] |
Stop previewing (yourself, or the given player). |
/rankview list |
List LuckPerms groups and any active previews. |
/rankview reload |
Reload config.yml. |
Previewing a different group while one is active switches to the new group automatically.
Permissions
| Permission |
Default |
Allows |
ezrankview.use |
op |
Preview a rank on yourself, list groups. |
ezrankview.others |
op |
Apply / clear a preview for another player. |
ezrankview.reload |
op |
Reload the config. |
ezrankview.admin |
op |
Grants all of the above. |
Configuration (config.yml)
preview:
apply-permissions: true # also preview the group's permissions
apply-chat-meta: true # copy the group's prefix/suffix so the tag shows
priority-offset: 1000 # priority bump so the preview outranks your real prefix
expire-after-seconds: 3600 # crash-safety expiry for the temp nodes (0 = until stopped)
restore-on-quit: true # clear a preview when the player logs out
All messages are editable under messages: and support & colour codes plus these
placeholders: %group%, %player%, %prefix%, %error%.
How it works
Under the hood it uses the LuckPerms API.
When a preview starts it:
- reads the resolved prefix/suffix of the target group from its cached metadata,
- adds matching
prefix/suffix nodes to the player at a higher priority,
- optionally adds a temporary
group.<name> inheritance node for permissions, and
- remembers the exact nodes it added.
Stopping the preview removes exactly those nodes. Nothing else about the player's data is
changed, and restore-on-quit plus the node expiry make leftover previews effectively
impossible.
Notes
- A preview is additive, so a player keeps their real permissions while previewing (the
previewed rank's permissions are layered on top). This keeps it safe to use on live players.
- The plugin only understands what LuckPerms itself resolves. If your chat/tab/nametag
formatting is handled by another plugin, that plugin will show the preview as long as it
reads LuckPerms prefixes (most do).
License
Released under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧