该插件提供了一个轻量级的 HTTP API,以 JSON 格式导出所有 Velocity 后端服务器的实时状态。
导出的字段可通过 config.yml 完全配置,允许安全地公开暴露。
游戏版本适用于 Velocity 4.3.0 支持的所有版本,因为它仅添加到代理服务器中。必须指定游戏版本,但详细信息请参阅 PaperMC 网站。
要求
- Velocity 4.3.0 或更高版本
- Java 25 或更高版本
自 velostat 2.0 起不再支持 Velocity 3.x。
安装
- 下载 插件的最新发布版本
- 将 velostat-x.x.jar 放入 velocity 的
/plugins 目录
过程完成!
配置参考
| 设置名称 |
描述 |
默认值 |
api.port |
内部 HTTP 服务器监听的端口号。 |
8080 |
ping.interval_seconds |
插件 ping 子服务器以收集状态的间隔(秒)。 |
10 |
export.server.name |
是否在 JSON 输出中包含服务器名称(在 Velocity 中定义)。 |
true |
export.server.address |
是否在 JSON 输出中包含服务器地址。 |
true |
export.server.status |
是否在 JSON 输出中包含在线/离线状态。 |
true |
export.server.motd |
是否在 JSON 输出中包含服务器的 MOTD(每日消息)。 |
true |
export.server.players |
是否在 JSON 输出中包含玩家数量(在线/最大)。 |
true |
export.server.version |
是否在 JSON 输出中包含游戏版本名称和协议版本。 |
true |
export.server.updated_at |
是否在 JSON 输出中包含最后更新时间戳。 |
true |
示例 Json 输出
访问 http://<SERVER_IP>:<PORT>/status> 将返回带有 Content-Type: application/json 的数据。
完整数据
{
"lobby": {
"name": "lobby",
"address": "127.0.0.1:25565",
"online": true,
"motd": "Welcome to the Lobby!",
"players": {
"online": 12,
"max": 100
},
"version": {
"name": "Paper 1.21.1",
"protocol": 767
},
"updated_at": 1704681000000
},
"survival": {
"name": "survival",
"address": "127.0.0.1:25566",
"online": false,
"motd": null,
"players": {
"online": 0,
"max": 0
},
"version": null,
"updated_at": 1704681000000
}
}
已配置数据
{
"lobby": {
"name": "lobby",
"online": true,
"motd": "Welcome to the Lobby!",
"players": {
"online": 12,
"max": 100
},
"updated_at": 1704681000000
},
"survival": {
"name": "survival",
"online": false,
"motd": null,
"players": {
"online": 0,
"max": 0
},
"updated_at": 1704681000000
}
}
字段描述
根对象
| 字段 |
类型 |
描述 |
servers |
array |
velocity.toml 中定义的服务器列表 |
服务器对象
| 字段 |
类型 |
描述 |
name |
string |
velocity.toml 的 [servers] 部分中定义的服务器名称 |
address |
string |
服务器地址 (host:port) |
online |
boolean |
服务器是否响应了 ping |
motd |
string |
服务器 MOTD(可能包含旧版颜色代码) |
players |
object |
玩家信息(仅在启用且服务器在线时存在) |
version |
object |
Minecraft 版本信息 |
updated_at |
number |
最后更新时间戳(UNIX 时间) |
玩家对象
| 字段 |
类型 |
描述 |
online |
number |
当前在线玩家数量 |
max |
number |
最大玩家容量 |
版本对象
| 字段 |
类型 |
描述 |
name |
string |
服务器报告的版本名称 |
protocol |
number |
Minecraft 协议版本 |
注意
- 根据
config.yml 的设置,某些字段可能会被省略。
- 如果服务器处于离线状态,则保证只有
name、address 和 online 字段存在。
- 此 API 旨在用于内部仪表板、状态页面或监控工具。
问题和疑问
如果插件无法正常工作,请尝试删除 config.yml。
问题和功能请求请在此处提出。
This plugin provides a lightweight HTTP API that exports the real-time status of all Velocity backend servers in JSON format.
Exported fields are fully configurable via config.yml, allowing safe public exposure.
The game version is for all versions supported by Velocity 4.3.0 as it is added to the proxy server only. The game version must be specified and is specified, but see the PaperMC website for details.
Requirements
- Velocity 4.3.0 or later
- Java 25 or later
Velocity 3.x is no longer supported since velostat 2.0.
Installation
- Download the latest release of the plugin
- Put velostat-x.x.jar in /plugins directory of velocity
This completes the process!
Config reference
| Setting name |
Description |
Default |
api.port |
The port number for the internal HTTP server to listen on. |
8080 |
ping.interval_seconds |
The interval (in seconds) at which the plugin pings sub-servers to collect status. |
10 |
export.server.name |
Whether to include the server name (defined in Velocity) in the JSON output. |
true |
export.server.address |
Whether to include the server address in the JSON output. |
true |
export.server.status |
Whether to include the online/offline status in the JSON output. |
true |
export.server.motd |
Whether to include the server's MOTD (Message of the Day) in the JSON output. |
true |
export.server.players |
Whether to include player counts (online/max) in the JSON output. |
true |
export.server.version |
Whether to include the game version name and protocol version in the JSON output. |
true |
export.server.updated_at |
Whether to include the last update timestamp in the JSON output. |
true |
Example Json output
Accessing http://<SERVER_IP>:<PORT>/status> will return data with a Content-Type: application/json.
FULL data
{
"lobby": {
"name": "lobby",
"address": "127.0.0.1:25565",
"online": true,
"motd": "Welcome to the Lobby!",
"players": {
"online": 12,
"max": 100
},
"version": {
"name": "Paper 1.21.1",
"protocol": 767
},
"updated_at": 1704681000000
},
"survival": {
"name": "survival",
"address": "127.0.0.1:25566",
"online": false,
"motd": null,
"players": {
"online": 0,
"max": 0
},
"version": null,
"updated_at": 1704681000000
}
}
Configured data
{
"lobby": {
"name": "lobby",
"online": true,
"motd": "Welcome to the Lobby!",
"players": {
"online": 12,
"max": 100
},
"updated_at": 1704681000000
},
"survival": {
"name": "survival",
"online": false,
"motd": null,
"players": {
"online": 0,
"max": 0
},
"updated_at": 1704681000000
}
}
Field Description
Root Object
| Field |
Type |
Description |
servers |
array |
List of servers defined in velocity.toml |
Server Object
| Field |
Type |
Description |
name |
string |
Server name defined in [servers] section of velocity.toml |
address |
string |
Server address (host:port) |
online |
boolean |
Whether the server responded to a ping |
motd |
string |
Server MOTD (may contain legacy color codes) |
players |
object |
Player information (only present if enabled and server is online) |
version |
object |
Minecraft version information |
updated_at |
number |
Last update timestamp(UNIX time) |
Players Object
| Field |
Type |
Description |
online |
number |
Current number of online players |
max |
number |
Maximum player capacity |
Version Object
| Field |
Type |
Description |
name |
string |
Version name reported by the server |
protocol |
number |
Minecraft protocol version |
Notes
- Fields may be omitted depending on
config.yml settings.
- If a server is offline, only
name, address, and online are guaranteed.
- This API is intended for internal dashboards, status pages, or monitoring tools.
Issue and question
If the plugin does not work properly, try deleting config.yml.
Problems and questions feature request here.
评论 0
登录后参与评分
还没有评论,来抢沙发吧