概览
PlayerWaypointColors 允许玩家自定义航点颜色,并允许管理员为其他玩家设置颜色。可选的 PlaceholderAPI 集成支持在玩家加入时自动分配颜色、将玩家的当前颜色导出给其他插件(聊天、计分板等),以及可配置的服务器默认颜色。
功能
- 为玩家航点分配自定义十六进制颜色(例如
#FF0000 或 FF0000 表示红色)
- 为玩家和管理员提供简单的命令
- 可配置的玩家加入时应用的默认颜色
- 可选的 PlaceholderAPI 集成:
- 在加入时通过占位符读取玩家的颜色(例如从 LuckPerms 元数据中读取)
- 通过
%pwc_color_<format>% 导出玩家的当前颜色,以便其他插件使用(MiniMessage、十六进制、原始值、旧版 Spigot 格式,或你定义的任何自定义格式)
兼容性
安装
- 下载最新的
PlayerWaypointColors.jar。
- 将其放入服务器的
plugins 文件夹中。
- (可选)如果你想要 PAPI 功能,请安装 PlaceholderAPI。
- 启动或重载你的服务器。
命令与权限
| 命令 |
描述 |
权限 |
默认状态 |
/pwc help |
显示帮助信息 |
playerwaypointcolor.help |
所有玩家 |
/pwc set <color|hex> [#hexcode] |
设置你自己的航点颜色 |
playerwaypointcolor.self |
OP |
/pwc setother <player> <color|hex> [#hexcode] |
设置其他玩家的航点颜色 |
playerwaypointcolor.others |
OP |
/pwc get |
获取你自己的航点颜色 |
playerwaypointcolor.self |
OP |
/pwc get <player> |
获取其他玩家的航点颜色 |
playerwaypointcolor.others |
OP |
/pwc reset |
重置你自己的航点颜色 |
playerwaypointcolor.self |
OP |
/pwc reset <player> |
重置其他玩家的航点颜色 |
playerwaypointcolor.others |
OP |
配置
插件首次运行时会在 config.yml 文件中创建配置文件。当添加新选项时,现有文件会就地升级。
示例配置:
placeholderapi:
auto-apply-on-join: false
variable: ""
placeholders:
formats:
minimessage: "<#{HEX}>"
hex: "#{HEX}"
raw: "{HEX}"
legacy: "&x&{R1}&{R2}&{G1}&{G2}&{B1}&{B2}"
default-color: ""
default-color-force: false
PlaceholderAPI 集成
PWC 以双向方式与 PlaceholderAPI 集成:它可以读取占位符以在加入时分配颜色,并且它暴露自己的占位符,以便其他插件可以读取每个玩家的当前颜色。
从占位符读取颜色(加入时自动应用)
在 config.yml 中将 variable 设置为一个返回 #00FF00 或 00FF00 格式十六进制代码的占位符(例如 %luckperms_meta_color%)。
最简单的设置是使用 LuckPerms 元数据:
- 在某个组上设置权限
meta.color.#FF0000
- 将
auto-apply-on-join 设置为 true
- 将
variable 设置为 %luckperms_meta_color%
- 保存 config.yml 并重启服务器
或者,使用 PlaceholderAPI String expansion(特别是 %string_replaceCharacters_<configuration>_<string>%)将另一个占位符强制转换为有效的十六进制代码。
向其他插件暴露玩家的当前颜色
PWC 注册了 %pwc_color_<format>%,其中 <format> 是 config.yml 中 placeholders.formats 下的任何键。开箱即用:
| 占位符 |
返回值 |
示例 |
%pwc_color_minimessage% |
MiniMessage 十六进制标签 |
<#FF0000> |
%pwc_color_hex% |
带前缀 # 的十六进制 |
#FF0000 |
%pwc_color_raw% |
不带前缀的 6 位十六进制 |
FF0000 |
%pwc_color_legacy% |
Spigot 旧版颜色代码 |
&x&F&F&0&0&0&0 |
在 config.yml 中添加你自己的键,以支持聊天或计分板插件所需的任何语法。模板可以使用以下变量(区分大小写):
{HEX} — 大写 6 位十六进制(例如 FF0000)
{hex} — 小写 6 位十六进制(例如 ff0000)
{R1} {R2} {G1} {G2} {B1} {B2} — 每个通道拆分为其两个十六进制数字
示例:使用 <#hex> MiniMessage 语法的聊天插件可以使用 %pwc_color_minimessage%<player_name></...> 这样的格式来用每个玩家选择的航点颜色对玩家名称进行着色。
如果玩家尚未选择或被分配颜色,无论请求何种格式,占位符都会返回空字符串。
加入时的默认颜色
将 default-color 设置为十六进制值(例如 00FF00)以将该颜色应用于尚没有颜色的玩家。留空以禁用。
default-color-force:
false(默认):仅在没有设置颜色的情况下应用默认颜色。不会覆盖玩家通过 /pwc set 选择的颜色。
true:每次加入时都应用默认颜色,覆盖玩家之前拥有的任何颜色——但上面设置的 auto-apply-on-join 颜色始终优先。
Overview
PlayerWaypointColors lets players set their own waypoint colors and lets admins set colors for other players. Optional PlaceholderAPI integration for automatic color assignment on join, exporting a player's current color to other plugins (chat, scoreboards, etc.), and configurable server defaults.
Features
- Assign custom hex colors to player waypoints (e.g.,
#FF0000 or FF0000 for red)
- Simple commands for players and admins
- Configurable default color applied to players on join
- Optional PlaceholderAPI integration:
- Read a player's color from a placeholder on join (e.g., from LuckPerms meta)
- Export the player's current color via
%pwc_color_<format>% so other plugins can use it (MiniMessage, hex, raw, legacy spigot, or any custom format you define)
Compatibility
Installation
- Download the latest
PlayerWaypointColors.jar.
- Place it in your server's
plugins folder.
- (Optional) Install PlaceholderAPI if you want PAPI features.
- Start or reload your server.
Commands & Permissions
| Command |
Description |
Permission |
Default |
/pwc help |
Show help message |
playerwaypointcolor.help |
all |
/pwc set <color|hex> [#hexcode] |
Set your own waypoint color |
playerwaypointcolor.self |
OP |
/pwc setother <player> <color|hex> [#hexcode] |
Set another player's waypoint color |
playerwaypointcolor.others |
OP |
/pwc get |
Get your own waypoint color |
playerwaypointcolor.self |
OP |
/pwc get <player> |
Get another player's waypoint color |
playerwaypointcolor.others |
OP |
/pwc reset |
Reset your own waypoint color |
playerwaypointcolor.self |
OP |
/pwc reset <player> |
Reset another player's waypoint color |
playerwaypointcolor.others |
OP |
Configuration
The plugin creates a config.yml file on first run. Existing files are upgraded in place when new options are added.
Example config:
placeholderapi:
auto-apply-on-join: false
variable: ""
placeholders:
formats:
minimessage: "<#{HEX}>"
hex: "#{HEX}"
raw: "{HEX}"
legacy: "&x&{R1}&{R2}&{G1}&{G2}&{B1}&{B2}"
default-color: ""
default-color-force: false
PlaceholderAPI Integration
PWC integrates with PlaceholderAPI in both directions: it can read a placeholder to assign a color on join, and it exposes its own placeholder so other plugins can read each player's current color.
Reading colors from a placeholder (auto-apply on join)
Set variable in config.yml to a placeholder (e.g., %luckperms_meta_color%) that returns a hex code in the format #00FF00 or 00FF00.
The easiest setup uses LuckPerms meta:
- Set the permission
meta.color.#FF0000 on a group
- Set
auto-apply-on-join to true
- Set
variable to %luckperms_meta_color%
- Save config.yml and restart your server
Alternatively, use the PlaceholderAPI String expansion (particularly %string_replaceCharacters_<configuration>_<string>%) to coerce another placeholder into a valid hex code.
Exposing a player's current color to other plugins
PWC registers %pwc_color_<format>% where <format> is any key under placeholders.formats in config.yml. Out of the box:
| Placeholder |
Returns |
Example |
%pwc_color_minimessage% |
MiniMessage hex tag |
<#FF0000> |
%pwc_color_hex% |
hex with leading # |
#FF0000 |
%pwc_color_raw% |
bare 6-character hex |
FF0000 |
%pwc_color_legacy% |
Spigot legacy color codes |
&x&F&F&0&0&0&0 |
Add your own keys in config.yml to support whatever syntax your chat or scoreboard plugin needs. Templates can use these variables (case-sensitive):
{HEX} — uppercase 6-char hex (e.g. FF0000)
{hex} — lowercase 6-char hex (e.g. ff0000)
{R1} {R2} {G1} {G2} {B1} {B2} — each channel split into its two hex digits
Example: a chat plugin using <#hex> MiniMessage syntax can format messages like %pwc_color_minimessage%<player_name></...> to color player names with each player's chosen waypoint color.
If a player hasn't picked or been assigned a color, the placeholder returns an empty string regardless of the format requested.
Default Color on Join
Set default-color to a hex value (e.g. 00FF00) to apply that color to players who don't already have one. Leave empty to disable.
default-color-force:
false (default): only applies the default if the player has no color set. Won't overwrite a color they picked with /pwc set.
true: applies the default on every join, overwriting whatever color the player previously had — except a color set by auto-apply-on-join above, which always wins.
评论 0
登录后参与评分
还没有评论,来抢沙发吧