NavItems — 使用物品在 HuskHomes 中通过 Shift+右键实现快捷传送
简介
将几种原版物品转化为快速旅行工具。NavItems 为这些物品添加了简洁的使用说明 lore(不修改名称),并在玩家按住 Shift + 右键时执行 HuskHomes 命令:
- 指南针 →
/warplist
- 探界 compass →
/homelist
- 山羊号角 →
/sethome home-<number>(编号是全局唯一的,永远不会重复使用)
- 书 →
/phomeslist(公共家园列表)
功能特性
- 手持物品时按住 Shift+右键以触发
- 始终显示的使用说明 lore
- 独特的家园命名:
home-1、home-2、home-3… 存储在 plugins/NavItems/data.yml 中,确保重启后编号也不会重复。
- 优先使用带命名空间的命令,其次回退到普通命令(例如
huskhomes:warplist → warplist)。
- 轻量级冷却时间(可配置),防止意外重复触发。
/navitems [player] 辅助命令,用于发放四种带有 lore 的物品。
依赖项
- 必需: HuskHomes (本插件执行的命令均源自 HuskHomes)。
- 必需: Updated HuskHomes GUI —— 如果缺失,则仅能通过触发
/warplist、/homelist 或 /phomeslist 来列出传送点和家园。
玩家仍需拥有相关的 HuskHomes 权限才能使用列表或设置家园。NavItems 仅负责触发命令;访问控制由 HuskHomes 处理。
命令与权限
命令
/navitems [player] — 给予指南针、探界 compass、山羊号角、书(均附带使用说明 lore)
权限
navitems.use — 允许使用这些物品(执行右键操作)
navitems.give — 允许使用 /navitems 命令(默认:op)
示例 (LuckPerms):
/lp group default permission set navitems.use true
/lp user <you> permission set navitems.give true
配置
plugins/NavItems/config.yml
commands:
warplist: "huskhomes:warplist"
homelist: "huskhomes:homelist"
phomeslist: "huskhomes:phomeslist"
sethome: "huskhomes:sethome %name%"
homeNamePrefix: "home-"
cooldownMs: 600
- 你可以自定义命令字符串或名称前缀。
- 使用带命名空间的命令可以确保即使其他插件添加了类似命令,也能准确调用 HuskHomes 的命令。
兼容性
- 服务端: Paper / Purpur(推荐使用 Paper)
- Minecraft 版本: 1.21.x
- Java 版本: 21
安装方法
- 将 JAR 文件放入
/plugins 文件夹。
- 启动服务器一次(生成
config.yml 和 data.yml)。
- 授予
navitems.use 权限(如果需要,也可授予 navitems.give)。
- (可选)安装 updated unofficial HuskHomes GUI 以获得列表的菜单界面。
常见问题
这会重命名物品吗?
不会——仅添加 lore。名称保持原版不变。
如果其他插件也使用了这些物品怎么办?
NavItems 在执行命令后会取消交互事件,并设有短暂的冷却时间。你也可以对不希望触发该功能的玩家组移除 navitems.use 权限。
我可以映射不同的物品或命令吗?
可以——编辑 config.yml 即可。代码量很小,如果你需要更深度的定制,很容易进行扩展。
更新日志(最新)
1.2.0
- 指南针 / 探界 compass / 山羊号角 / 书的右键动作支持
- 为这些原版物品添加始终显示的使用说明 lore
- 全局持久化的
home-<number> 命名机制
- 带命名空间的 HuskHomes 命令及回退机制
/navitems 辅助命令
NavItems — item shift right-click shortcuts for HuskHomes
Summary
Turns a few vanilla items into fast travel tools. NavItems adds concise usage lore to those items (without renaming) and runs HuskHomes commands on shift + right-click:
- Compass →
/warplist
- Recovery Compass →
/homelist
- Goat Horn →
/sethome home-<number> (number is global, never re-used)
- Book →
/phomeslist (public homes)
Features
- Shift+Right-click while holding item to trigger
- Always-on instructive lore
- Unique home names:
home-1, home-2, home-3… stored in plugins/NavItems/data.yml so numbers never repeat across restarts.
- Namespaced command first, fallback second (e.g.
huskhomes:warplist → warplist).
- Light cooldown (configurable) to prevent accidental double-fires.
/navitems [player] helper command to hand out the four items (with lore).
Dependencies
- Required: HuskHomes (the commands this plugin runs come from HuskHomes).
- Required: Updated HuskHomes GUI — if missing, it will only list warps and homes by triggering
/warplist, /homelist, or /phomeslist
Players still need the relevant HuskHomes permissions to use the lists or set homes. NavItems only triggers the commands; HuskHomes handles access.
Commands & permissions
Commands
/navitems [player] — gives Compass, Recovery Compass, Goat Horn, Book (all with usage lore)
Permissions
navitems.use — allow using the items (right-click actions)
navitems.give — allow /navitems (default: op)
Example (LuckPerms):
/lp group default permission set navitems.use true
/lp user <you> permission set navitems.give true
Configuration
plugins/NavItems/config.yml
commands:
warplist: "huskhomes:warplist"
homelist: "huskhomes:homelist"
phomeslist: "huskhomes:phomeslist"
sethome: "huskhomes:sethome %name%"
homeNamePrefix: "home-"
cooldownMs: 600
- Change the command strings or the name prefix if you like.
- Namespaced commands ensure HuskHomes is targeted even if other plugins add similar commands.
Compatibility
- Server: Paper / Purpur (Paper recommended)
- Minecraft: 1.21.x
- Java: 21
Installation
- Drop the JAR into
/plugins.
- Start the server once (generates
config.yml & data.yml).
- Grant
navitems.use (and, if desired, navitems.give).
- (Optional) Install the updated unofficial HuskHomes GUI to get menu UIs for the lists.
FAQ
Does this rename items?
No — only lore is added. Names remain vanilla.
What if another plugin uses these items too?
NavItems cancels the interaction after firing the command and has a short cooldown. You can also withhold navitems.use from groups that shouldn’t trigger it.
Can I map different items or commands?
Yes — edit config.yml. The code is small and easy to extend if you want deeper customization.
Changelog (latest)
1.2.0
- Right-click actions for Compass / Recovery Compass / Goat Horn / Book
- Always-on lore for those vanilla items
- Global, persistent
home-<number> naming
- Namespaced HuskHomes commands with fallback
/navitems helper command
评论 0
登录后参与评分
还没有评论,来抢沙发吧