GPS
一款适用于 Spigot/Paper 服务器的轻量级、原版风格 GPS 插件。
利用玩家自带的指南针指向坐标、自定义地标或另一名玩家——就像现实生活中一样。没有多余的lore(描述文本),没有花哨的功能,仅提供导航。
支持:Spigot 1.13+ / Paper
Java:17+
依赖项:无
风格:兼容原版
功能特性
- 指南针目标:坐标、地标、跟随玩家
- 个人地标(添加 / 列表 / 删除 / 分享 / 前往 / 传送)
- /gps tell 和 /gps share 在聊天中广播位置
- /gps chat - 将上一次广播的坐标抓取到指南针中
- 实时操作栏 (Action-bar) 显示距离,并根据接近程度着色
- 当距离缩短至初始距离的 50% 时触发里程碑提示
- 热键栏第 8 格放置原版指南针物品
- 到达时播放声音 + 自动恢复指南针方向
- 持久化存储目标和地标(按玩家区分)
- 使用两个独立的调度器(HUD 更新和到达检测)以优化性能
- 完全可配置:消息、颜色、间隔、半径、声音
命令与权限
- 权限: gps.use
- /gps 显示你自己的位置(私密)。
- /gps help 显示游戏内帮助信息。
- /gps tell 向全服广播你的位置。
- /gps <x> <y> <z> 将指南针设定为给定坐标。
- /gps clear 将指南针恢复至上一个方向。
- 权限: gps.waypoints
- /gps add <name> 将当前位置保存为地标。
- /gps list 列出你所有的地标及其索引和坐标。
- /gps remove <idx> 通过三位数的索引删除其中一个地标。
- /gps share <idx> 向所有人广播地标的坐标。
- /gps go <idx> 将指南针指向某个地标。
- 权限: gps.chat
- /gps chat 将指南针设定为上一次广播的坐标。
- 权限: gps.follow
- /gps follow <player> 用指南针实时追踪另一名玩家。
- 权限: gps.teleport
- /gps tp <idx> 传送到你自己的某个地标。
配置
所有配置均位于 plugins/GPS/config.yml。
所有数值型间隔在启动时都会进行验证(必须为大于等于 1 的整数)。
USE_SOUND true/false 开启广播/到达时的音效。
USE_PERMISSIONS true/false 切换权限系统。
PERMISSION gps.use 默认权限节点。
ARRIVAL_RADIUS 3.0 被视为“已到达”的距离(米)。
ARRIVAL_SOUND true/false 到达时播放声音。
ALLOW_CROSS_WORLD false 限制目标仅限玩家所在世界。
MAX_COORD 30000000 坐标合理性检查上限。
CHECK_ARRIVAL_INTERVAL 2 两次到达/跟随检查之间的秒数(整数,>= 1)。
HUD_TICK_INTERVAL 1 两次操作栏刷新之间的秒数(整数,>= 1)。
SHOW_DISTANCE_HUD true 在热键栏上方显示实时距离。
HUD_COLOR_FAR 100 “远”色阈值(米)。
HUD_COLOR_MID 25 “中”色阈值(米)。
HUD_COLOR_NEAR 5 “近”色阈值(米)。
COLOR_FAR &a 绿色 (> 100m)
COLOR_MID &e 黄色 (100m .. 25m]
COLOR_NEAR &6 金色 (25m .. 5m]
COLOR_ARRIVED &c 红色 (<= ARRIVAL_RADIUS)
MILESTONE_FACTOR 0.5 触发里程碑提示时的初始距离比例。
MILESTONE_COOLDOWN 30 两条里程碑消息之间的冷却时间(防刷屏)。
--> 如果 CHECK_ARRIVAL_INTERVAL 或 HUD_TICK_INTERVAL 的值非整数,控制台将发出警告并替换为默认值。
工作原理
设定目标
指南针现在指向这些坐标。一个带有 GPS 标记名称的原版指南针物品会被放置在玩家的热键栏(第 8 格)。
实时追踪
热键栏上方的操作栏会显示实时距离,并随着玩家移动改变颜色:
-
100m : COLOR_FAR (默认绿色)
- 25m .. 100m : COLOR_MID (默认黄色)
- 5m .. 25m : COLOR_NEAR (默认金色)
- <= radius : COLOR_ARRIVED (默认红色)
地标
- /gps add home -> 返回一个三位数索引,例如 001
- /gps list -> 显示所有地标及其索引
- /gps tp 001 -> 传送到该地标(同一世界内)
- /gps share 001 -> 向所有人广播该地标的坐标
- /gps remove 001 -> 删除它
聊天抓取
任何人都可以广播 /gps tell 或 /gps share <idx>。坐标会被记忆。其他玩家可以随后输入 /gps chat 将这些坐标复制到他们自己的指南针中——实现一步到位的“跟随消息”。
跟随
指南针实时追踪该玩家。如果对方下线或你在 ARRIVAL_RADIUS 范围内追上他们,追踪会自动清除。
里程碑
当当前距离降至初始距离的 MILESTONE_FACTOR(默认 50%)以下时,会发送一次“你正在靠近”的提示。随后的里程碑受 MILESTONE_COOLDOWN 限制。
到达
当玩家进入目标 ARRIVAL_RADIUS 范围内时,指南针恢复至上一个方向,GPS 指南针物品被移除,播放声音(如果启用了 ARRIVAL_SOUND),并显示“已到达”消息。
示例
Alice:
Bob:
Bob 走向目标:
-> 操作栏距离:423m -> 绿色
-> 在 211m(50%)处:里程碑提示 "You're getting closer! ~211m to chat:(Alice)"
-> 在 25m 处变黄 / 在 5m 处变金 / 在 3m 处变红
-> "You've arrived at your destination. Compass restored."
安装
- 将
GPS-v.X.jar 放入服务器的 plugins/ 文件夹中。
- (重新)启动服务器。首次运行时会自动生成
config.yml。
- 根据需要编辑
plugins/GPS/config.yml。
- 再次(重新)启动服务器以应用间隔更改。
- 完成。
权限 (PERMISSIONS)
所有权限默认均为 FALSE。除非服务器管理员通过你的权限插件(如 LuckPerms、PermissionsEx、GroupManager 等)明确授予,否则玩家没有任何访问权限。
未获得这些权限时,执行 /gps 会返回:
“你没有权限。”
CONFIG.YML
options:
USE_SOUND: true
USE_PERMISSIONS: true
ARRIVAL_RADIUS: 3.0
ARRIVAL_SOUND: true
ALLOW_CROSS_WORLD: false
MAX_COORD: 30000000
CHECK_ARRIVAL_INTERVAL: 2 # 秒 (整数 >= 1)
HUD_TICK_INTERVAL: 1 # 秒 (整数 >= 1)
SHOW_DISTANCE_HUD: true
HUD_COLOR_FAR: 100
HUD_COLOR_MID: 25
HUD_COLOR_NEAR: 5
COLOR_FAR: "&a" # 绿色
COLOR_MID: "&e" # 黄色
COLOR_NEAR: "&6" # 金色
COLOR_ARRIVED: "&c" # 红色
MILESTONE_FACTOR: 0.5
MILESTONE_COOLDOWN: 30
为什么选择本模组
市面上大多数“GPS”类插件要么重写指南针,要么滥用 NMS(非标准 Minecraft 代码),或者需要客户端模组支持。本模组完全保持原版体验:它仅使用玩家自带的指南针、操作栏(action-bar)以及快捷栏中的普通指南针物品。无需协议破解,无需安装客户端,没有意外惊喜。
灵感来源于现实生活中的导航:设置坐标,跟随指针,抵达目的地。
非常适合生存服务器、探索者、寻宝游戏、角色扮演场景以及世界内的竞速活动。
许可证:私人用途免费。禁止修改源代码中的署名信息。
GPS
A lightweight, vanilla-style GPS plugin for Spigot/Paper servers.
Uses the player's built-in compass to point at coordinates, waypoints, or another player - like in real life. No lore, no fluff, just navigation.
Supported : Spigot 1.13+ / Paper
Java : 17+
Dependencies : None
Style : Vanilla-friendly
FEATURES
- Compass targets: coords, waypoints, player follow
- Personal waypoints (add / list / remove / share / go / tp)
- /gps tell & /gps share to broadcast positions in chat
- /gps chat - grab the last broadcast coords into your compass
- Live action-bar with distance, color-coded by proximity
- Milestone alerts at 50% of the initial distance
- Vanilla compass item placed in the hotbar (slot 8)
- Arrival sound + automatic compass restoration
- Persistent targets and waypoints (per-player)
- Two independent schedulers (HUD and arrival) for performance
- Fully configurable: messages, colors, intervals, radius, sound
COMMANDS / PERMISSIONS
- Permission: gps.use
- /gps Show your own position (private).
- /gps help Display the in-game help.
- /gps tell Broadcast your position to the whole server.
- /gps <x> <y> <z> Set the compass to the given coordinates.
- /gps clear Restore the compass to its previous direction.
- Permission: gps.waypoints
- /gps add <name> Save your current position as a waypoint.
- /gps list List all your waypoints with index and coords.
- /gps remove <idx> Remove one of your waypoints by its 3-digit index.
- /gps share <idx> Broadcast a waypoint's coords to everyone.
- /gps go <idx> Set the compass to a waypoint.
- Permission: gps.chat
- /gps chat Set your compass to the last broadcast coords.
- Permission: gps.follow
- /gps follow <player> Live-track another player with your compass.
- Permission: gps.teleport
- /gps tp <idx> Teleport to one of your own waypoints.
CONFIGURATION
Everything lives in plugins/GPS/config.yml.
All numeric intervals are validated on startup (must be int >= 1).
USE_SOUND true/false Enable sounds on broadcast/arrival.
USE_PERMISSIONS true/false Toggle the permission system.
PERMISSION gps.use Default permission node.
ARRIVAL_RADIUS 3.0 Meters considered "arrived".
ARRIVAL_SOUND true/false Sound on arrival.
ALLOW_CROSS_WORLD false Restrict targets to player's world.
MAX_COORD 30000000 Coordinate sanity limit.
CHECK_ARRIVAL_INTERVAL 2 Seconds (int, >= 1) between arrival/follow checks.
HUD_TICK_INTERVAL 1 Seconds (int, >= 1) between action-bar refreshes.
SHOW_DISTANCE_HUD true Show live distance above hotbar.
HUD_COLOR_FAR 100 Threshold for FAR color (meters).
HUD_COLOR_MID 25 Threshold for MID color (meters).
HUD_COLOR_NEAR 5 Threshold for NEAR color (meters).
COLOR_FAR &a Green (> 100m)
COLOR_MID &e Yellow (100m .. 25m]
COLOR_NEAR &6 Gold (25m .. 5m]
COLOR_ARRIVED &c Red (<= ARRIVAL_RADIUS)
MILESTONE_FACTOR 0.5 Fraction of initial distance at which the milestone alert fires.
MILESTONE_COOLDOWN 30 Seconds between two milestone messages (anti-spam).
--> Non-integer values for CHECK_ARRIVAL_INTERVAL or HUD_TICK_INTERVAL are rejected with a console warning and replaced by the default value.
HOW IT WORKS
Set a target
The compass now points to those coordinates. A vanilla compass item is
placed in the player's hotbar (slot 8) with the GPS marker in its name.
Live tracking
The action-bar above the hotbar shows the live distance and color-codes
itself as the player moves:
-
100m : COLOR_FAR (default green)
- 25m .. 100m : COLOR_MID (default yellow)
- 5m .. 25m : COLOR_NEAR (default gold)
- <= radius : COLOR_ARRIVED (default red)
Waypoints
- /gps add home -> returns a 3-digit index, e.g. 001
- /gps list -> shows all your waypoints with their indices
- /gps tp 001 -> teleport to that waypoint (same world)
- /gps share 001 -> broadcast the waypoint's coords to everyone
- /gps remove 001 -> delete it
Chat-grab
Anyone broadcasts /gps tell or /gps share <idx>. The coords are
memorized. Other players can then type /gps chat to copy those coords
into their own compass - a one-step "follow the message".
Follow
Compass live-tracks the player. Auto-clears if they log out or if you
reach them within ARRIVAL_RADIUS.
Milestones
When the current distance falls under MILESTONE_FACTOR (default 50%) of
the initial distance, a single "you're getting closer" alert is sent.
Subsequent milestones are gated by MILESTONE_COOLDOWN.
Arrival
When the player is within ARRIVAL_RADIUS of the target, the compass
restores to its previous direction, the GPS compass item is removed,
a sound plays (if ARRIVAL_SOUND is enabled) and an "arrived" message
is shown.
EXAMPLE
Alice:
Bob:
Bob walks toward the target:
-> action-bar distance: 423m -> green
-> at 211m (50%): milestone "You're getting closer! ~211m to chat:(Alice)"
-> at 25m: yellow / at 5m: gold / at 3m: red
-> "You've arrived at your destination. Compass restored."
INSTALLATION
- Drop GPS-v.X.jar into your server's plugins/ folder.
- (Re)start the server. config.yml is auto-generated on first run.
- Edit plugins/GPS/config.yml to your taste.
- (Re)start the server again to apply interval changes.
- Done.
PERMISSIONS
All permissions default to FALSE. Players have NO access until the
server owner explicitly grants them via your permission plugin
(LuckPerms, PermissionsEx, GroupManager, etc.).
Without these grants, /gps returns:
"You do not have permission."
CONFIG.YML
options:
USE_SOUND: true
USE_PERMISSIONS: true
ARRIVAL_RADIUS: 3.0
ARRIVAL_SOUND: true
ALLOW_CROSS_WORLD: false
MAX_COORD: 30000000
CHECK_ARRIVAL_INTERVAL: 2 # seconds (int >= 1)
HUD_TICK_INTERVAL: 1 # seconds (int >= 1)
SHOW_DISTANCE_HUD: true
HUD_COLOR_FAR: 100
HUD_COLOR_MID: 25
HUD_COLOR_NEAR: 5
COLOR_FAR: "&a" # green
COLOR_MID: "&e" # yellow
COLOR_NEAR: "&6" # gold
COLOR_ARRIVED: "&c" # red
MILESTONE_FACTOR: 0.5
MILESTONE_COOLDOWN: 30
WHY
Most "GPS" plugins out there either rewrite the compass, abuse NMS, or require client-side mods. This one stays 100% vanilla: it only uses the player's built-in compass, the action-bar, and a regular compass item in the hotbar. No protocol hacks, no client install, no surprises.
Inspired by real-life navigation: set coords, follow the needle, arrive.
Perfect for survival servers, explorers, treasure hunts, roleplay scenarios and races across your world.
License : Free for private use. Modification of the authorship
in the source is not allowed.
评论 0
登录后参与评分
还没有评论,来抢沙发吧