一个轻量级的 SpigotMC 插件,允许你在服务器中定义特定区域。当玩家进入指定区域时,其名称会自动显示在操作栏(Action Bar)上。
区域创建与管理
- 定义区域: 通过选择两个点(pos0 和 pos1)来创建一个矩形边界以形成区域。
- ID 与显示名称: 每个区域使用内部 ID 进行管理,并拥有一个可供自定义的显示名称供玩家查看。
- 数据持久化: 所有区域数据均保存在
areas.yml 文件中,确保即使服务器重启设置也能得以保留。
进入与离开检测
- 实时检测: 每当玩家在方块间移动时,插件会检查其是否处于已注册区域内。
- 操作栏通知: 玩家进入区域时,区域的显示名称会出现在屏幕底部中央的操作栏中。
- 可配置行为: 多种操作栏行为可通过
config.yml 中的 action-bar 部分进行自定义。
- 持续显示: 当
keep-alive 设置为 true(默认值)时,只要玩家留在区域内,操作栏消息就会不断刷新。
- 单次显示: 当
keep-alive 设置为 false 时,消息仅在进入时显示一次,并在大约 3 秒后自然淡出。
- 自动清除: 当玩家离开区域时,操作栏停止发送消息并在客户端侧淡出。
- 立即清除: 将
force-clear-on-exit 设置为 true 会在离开时立即清除操作栏,而不是等待自然淡出。
- 优先级系统: 如果多个区域重叠,最先检测到的区域将在显示时拥有优先级。
操作栏兼容性
操作栏只有一个槽位,因此当其他插件也向其中发送消息时,消息会相互覆盖导致文字闪烁。如果安装了 ProtocolLib 或 PacketEvents (2.x),OnArea 会通过将区域名称添加到其他插件的消息中而非与之竞争来避免此问题。
- 消息合并: 其他插件的操作栏消息将与区域名称一同显示,两者之间放置设置在
merge.separator 中的文本。默认情况下,区域名称位于其他消息之后。
- 可选依赖: 只需安装 ProtocolLib 或 PacketEvents 其中之一即可。如果两者都安装了,则只使用其中一个。如果均未安装,插件按原有方式工作,单独发送区域名称。
- 注意: 由于操作栏居中显示,添加区域名称时,其他插件的消息位置会略微偏移。
以下设置可在 config.yml 的 action-bar 部分中找到:
mode: auto(默认;如果安装了 ProtocolLib 或 PacketEvents 则合并,否则按原有方式工作)、merge(与 auto 相同,但如果未安装任一库则在控制台记录警告)、standalone(从不合并;每秒重新发送区域名称)。
merge.provider: 使用的库。auto(优先 ProtocolLib)、protocollib 或 packetevents。
merge.position: 放置区域名称的位置。suffix(在其他插件消息之后,默认)或 prefix(在其之前)。
merge.separator: 放置在两条消息之间的文本(默认:两个空格)。
多语言支持
- 支持 9 种语言:日本語, English, 简体中文, 한국어, Español, Português, Русский, Deutsch, Français
- 系统会自动检测玩家的 Minecraft 客户端语言,并以相应语言显示消息。
- 对于不支持的语言,将使用服务器的默认语言。你可以在
config.yml 的语言设置中进行配置(将其设置为 auto 将根据服务器操作系统自动检测语言)。
- 玩家也可以使用
/onarea lang 命令手动设置他们的语言。这些个人设置即使在服务器重启后也会保留。
命令
所有命令都需要 onarea.admin 权限。
/onarea pos0 [x y z] – 设置起点。如果省略坐标,则使用你当前的位置。
/onarea pos1 [x y z] – 设置终点。如果省略坐标,则使用你当前的位置。
/onarea create <ID> <DisplayName> – 在两个指定点之间注册一个新区域。
/onarea edit <ID> <DisplayName> – 更新现有区域的显示名称。
/onarea delete <ID> – 删除指定区域。
/onarea list – 显示所有已注册区域的列表。
/onarea lang – 显示当前语言设置及其来源(手动/自动)。
/onarea lang <code> – 更改语言(ja, en, zh, ko, es, pt, ru, de, fr)
/onarea lang reset – 清除手动语言设置并恢复为自动检测。
/onarea debug – 显示带有边框的已注册区域。再次运行将隐藏它们。
A lightweight SpigotMC plugin that allows you to define specific areas within your server. When a player enters a designated area, its name is automatically displayed on their action bar.
Area Creation & Management
- Defining Areas: Create areas by selecting two points (pos0 and pos1) to form a rectangular boundary.
- IDs & Display Names: Each area uses an internal ID for management and a customizable display name for players.
- Data Persistence: All area data is saved in
areas.yml, ensuring settings are preserved even after a server restart.
Entry & Exit Detection
- Real-time Detection: The plugin checks whether a player is within a registered area whenever they move between blocks.
- Action Bar Notifications: The area's display name appears at the bottom-center of the screen (Action Bar) upon entry.
- Configurable Behavior: Several action bar behaviors can be customized via the
action-bar section in config.yml.
- Persistent Display: When
keep-alive is set to true (default), the action bar message is refreshed continuously while the player remains inside the area.
- Single Display: When
keep-alive is set to false, the message is shown only once on entry and fades out naturally after approximately 3 seconds.
- Automatic Clearing: When a player exits an area, the action bar stops being sent and fades out on the client side.
- Instant Clearing: Setting
force-clear-on-exit to true clears the action bar immediately upon exit instead of waiting for the natural fade.
- Priority System: If multiple areas overlap, the first area detected will take priority for the display.
Action Bar Compatibility
The action bar has only one slot, so when other plugins also send messages to it, the messages overwrite each other and the text flickers. If ProtocolLib or PacketEvents (2.x) is installed, OnArea avoids this by adding the area name to the other plugin's message instead of competing with it.
- Message Merging: The other plugin's action bar message is shown together with the area name, with the text set in
merge.separator placed between them. By default the area name comes after the other message.
- Optional Dependency: Only one of ProtocolLib or PacketEvents is needed. If both are installed, only one is used. If neither is installed, the plugin works as before and sends the area name on its own.
- Note: The action bar is centered on screen, so the other plugin's message shifts slightly when the area name is added.
The following settings are available in the action-bar section of config.yml:
mode: auto (default; merges if ProtocolLib or PacketEvents is installed, otherwise works as before), merge (same as auto, but logs a warning to the console if neither is installed), standalone (never merges; resends the area name every second).
merge.provider: Which library to use. auto (ProtocolLib first), protocollib, or packetevents.
merge.position: Where to put the area name. suffix (after the other plugin's message, default) or prefix (before it).
merge.separator: Text placed between the two messages (default: two spaces).
Multilingual Support
- Supports 9 languages: 日本語, English, 简体中文, 한국어, Español, Português, Русский, Deutsch, Français
- The system automatically detects the player's Minecraft client language and displays messages in the corresponding language.
- For unsupported languages, the server's default language will be used. You can configure this in
config.yml under the language setting (setting it to auto will automatically detect the language based on the server's OS).
- Players can also manually set their language using the
/onarea lang command. These individual settings will persist even after a server restart.
Commands
All commands require the onarea.admin permission.
/onarea pos0 [x y z] – Sets the starting point. Uses your current location if coordinates are omitted.
/onarea pos1 [x y z] – Sets the end point. Uses your current location if coordinates are omitted.
/onarea create <ID> <DisplayName> – Registers a new area between the two specified points.
/onarea edit <ID> <DisplayName> – Updates the display name of an existing area.
/onarea delete <ID> – Deletes the specified area.
/onarea list – Displays a list of all registered areas.
/onarea lang – Displays the current language setting and its source (manual/automatic).
/onarea lang <code> – Changes the language (ja, en, zh, ko, es, pt, ru, de, fr)
/onarea lang reset – Clears the manual language setting and reverts to automatic detection.
/onarea debug – Displays registered areas with borders. Running it again will hide them.
评论 0
登录后参与评分
还没有评论,来抢沙发吧