VelocityScoreboardAPI 是由 NEZNAMY(TAB)、William278(Velocitab)和 AlexDev_(Velocitab)开发的 API 插件,为 Velocity 代理服务器提供用于与记分板交互的 API。这使得开发者能够以标准方式执行记分板/队伍操作,而无需依赖 Velocity 提供的原生 API。本插件本身不提供任何功能。
服务器管理员
请将此插件添加到您的 Velocity 服务器的 plugins 文件夹中。请确保您运行的是最新版本的 Velocity(请参阅下方的要求)。
要求
- Java 21+
- Velocity 3.5.0 build 604+
开发者
VelocityScoreboardAPI 可在 Maven 上获取。您可以在此处浏览 Javadocs:这里。
首先,将 Maven 仓库添加到您的 build.gradle 文件中:
repositories {
maven { url "https://repo.william278.net/releases" }
// maven { url "https://repo.william278.net/snapshots" } // 用于快照版本构建
}
然后,添加该依赖项。将 VERSION 替换为最新版本。(例如 1.0)
dependencies {
implementation "net.william278:velocityscoreboardapi:VERSION"
}
使用 Maven 或其他构建工具?有关如何包含 VelocityScoreboardAPI 的说明,请参见 仓库浏览器。
配置
插件提供了一个配置文件。配置文件位于 plugins/velocity-scoreboard-api/config.yml。当插件首次加载时,会自动生成配置文件。配置文件包含以下选项:
# 是否触发记分板 API 事件
call_scoreboard_events: true
# 是否记录来自下游服务器的无效数据包
print_invalid_downstream_packet_warnings: true
插件亮点
- 代理记分板 vs 后端记分板 - 每个玩家拥有两个记分板。
- 后端记分板 - 只读跟踪器,用于追踪来自后端服务器的目标和队伍(也用于内部以确保兼容性)。
- 代理记分板 - 可通过 API 完全编辑的记分板。所有队伍(及其条目)和目标都将优先于后端记分板生效。每个玩家拥有独立的代理记分板实例。
- 事件系统 - 每当注册或注销目标、或将玩家添加/移除出队伍时触发事件。可在配置文件中禁用。
- 用于更新属性的 Consumer - 为了允许通过单个数据包一次性执行多项更改,而不是为每项单独更改发送更新数据包,所有更新方法均支持
Consumer<?>参数。与全参方法不同,这提供了良好的兼容性:如果未来 MC 版本添加了新内容,而无需显式支持使用旧方法的插件,也能正常运作。 - 高性能 - 在拥有 4000+ 名玩家的大型服务器上测试,该插件达到了完美的性能表现。部分代码因此略显复杂,但如果决定牺牲性能以简化代码,可以随时进行,且无需担心性能问题。
- 无效数据包取消 - 无效的后端数据包会被取消或修复,以防止客户端在接收到无效后端数据包时出现警告、错误或断开连接。
- 自定义 TextHolder 类 - 为了同时支持传统文本和现代组件,使用了自定义类
TextHolder作为值,允许用户明确指定针对特定版本的值,而无需检查客户端版本(如果未指定其中一个值,系统将自动计算)。
数据上传
Modrinth 内容规则 1.11 要求所有资源必须披露向远程服务器上传数据的情况,具体如下:
- bStats.org - 一个允许作者查看其插件统计数据的网站。这些数据可用于决定未来的开发方向。本插件的 bStats 页面可在此处找到:这里。
- pastes.dev - 当运行
/vsa dump <...>命令时,玩家的记分板数据(目标、队伍)将上传至该粘贴板网站,以便在开发人员调试问题时请求共享这些信息。
VelocityScoreboardAPI is an API plugin by NEZNAMY (TAB), William278 (Velocitab) and AlexDev_ (Velocitab), providing Velocity proxy servers with an API for interfacing with Scoreboard. This allows developers a standard way of performing scoreboard/team operations in lieu of an API provided by Velocity. This plugin does not provide any features on its own.
Server owners
Please add the plugin to your Velocity server's plugins folder. Make sure you are running the latest version of Velocity (check the requirements below).
Requirements
- Java 21+
- Velocity 3.5.0 build 604+
Developers
VelocityScoreboardAPI is available on Maven. You can browse the Javadocs here.
First, add the Maven repository to your build.gradle file:
repositories {
maven { url "https://repo.william278.net/releases" }
// maven { url "https://repo.william278.net/snapshots" } // For snapshot builds
}
Then, add the dependency itself. Replace VERSION with the latest version. (e.g., 1.0)
dependencies {
implementation "net.william278:velocityscoreboardapi:VERSION"
}
Using Maven/something else? There's instructions on how to include VelocityScoreboardAPI on the repo browser.
Config
A configuration file is provided for the plugin. The configuration file is located at plugins/velocity-scoreboard-api/config.yml. The configuration file is automatically generated when the plugin is loaded for the first time. The configuration file contains the following options:
# Whether scoreboard API events should be fired
call_scoreboard_events: true
# Whether to log invalid packets received from downstream servers
print_invalid_downstream_packet_warnings: true
Plugin highlights
- Proxy vs backend scoreboard - Every player has 2 scoreboards.
- Backend scoreboard - A read-only tracker of objectives and teams coming from backend server (also used internally for proper compatibility).
- Proxy scoreboard - Scoreboard fully editable using the API. All teams (and their entries) and objectives will take priority over backend scoreboard. Every player has their own proxy scoreboard instance.
- Event system - Events called every time an objective or team is registered, unregistered or player is added/removed from a team. Can be disabled in config.
- Consumers for updating properties - In order to allow performing multiple changes at once with a single packet instead of sending update packet for each individual change, all updates support methods using Consumer<?>. Unlike with an all-arg method, this offers great compatibility in case something is added in future MC versions without having to explicitly support plugins using old method.
- High performance - Tested on a huge server with 4000+ players, the plugin has reached perfect performance. Some code is slightly complex because of this, however, simplifying code at the cost of worse performance can be done any time if decided without having to worry about performance.
- Invalid packet cancellation - Invalid backend packets are cancelled or fixed to prevent warnings/errors/disconnects in the client when an invalid backend packet is received.
- Custom TextHolder class - For allowing to configure both legacy texts and modern components, custom class
TextHolderis used as value, allowing users to explicitly define per-version values without having to check for client version (if one of the two values is not specified, it will be calculated)
Uploading of data
Modrinth rule 1.11 of Content Rules requires all resources to discose upload of data to a remote server, so here it is:
- bStats.org - Website that allows authors to see stats about their plugins. This data may be used for deciding the future path of the development. The bStats page for this plugin can be found here.
- pastes.dev - When running
/vsa dump <...>, player's scoreboard data (objectives, teams) is uploaded to the paste site, which allows easy sharing if this information is requested by a developer when troubleshooting a bug for example.
下载 VelocityScoreboardAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 VelocityScoreboardAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 VelocityScoreboardAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 VelocityScoreboardAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 VelocityScoreboardAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 VelocityScoreboardAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 VelocityScoreboardAPI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 新增对 Minecraft 26.3 的支持
- 修复了在 Velocity 4.0.0+ 上执行
/vsa dump时的错误
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
自定义你的Minecraft头像!
插件
通过数据包为工作台、熔炉、附魔台等添加动画效果!
插件
一个功能丰富、完全动画化的箱子插件,适用于 Paper 1.21.x,支持 IA、Vault、PlaceholderAPI 和 Citizens
插件
使用数据包实现的简单、轻量且快速的 NPC 插件
插件
免费、开源的全息投影和动态 NPC 系统,支持一键部署,可在游戏内、浏览器中或通过 YAML 文件进行编辑。
插件
为已修剪的盔甲添加粒子效果
评论 0
登录后参与评分
还没有评论,来抢沙发吧