Velocitab/docs/Plugin-Message-API-Examples.md
AlexDev_ 4efc5797b3
feat: add plugin message api, GROUP_PLAYERS_ONLINE placeholder (#157)
* Added plugin message api & added LOCAL_GROUP_PLAYERS_ONLINE placeholders

* Fixed conversations, added placeholders to docs and fixed a few bugs

* Solved conversation

* Fixed possible charset problem and moved channels to a map instead of a set

* Changed docs

* Fixed kick issue and fixed problem header/footer on join
2024-02-09 23:58:15 +00:00

27 lines
1.0 KiB
Markdown

Velocitab provides a plugin message API.
## API Requests from Backend Plugins
### 1 Changing player's username in the TAB List
To change a player's username in the tablist, you can send a plugin message with the channel `velocitab:main` and as data `UPDATE_CUSTOM_NAME:::customName`.
Remember to replace `customName` with the desired name.
<details>
<summary>Example &mdash; Changing player's username in the TAB List</summary>
```java
player.sendPluginMessage(plugin, "velocitab:update_custom_name", "Steve".getBytes());
```
</details>
### 2 Update team color
To change a player's team color in the TAB List, you can send a plugin message with the channel `velocitab:main` and as data `UPDATE_TEAM_COLOR:::teamColor`.
You can only use legacy color codes, for example `a` for green, `b` for aqua, etc.
This option overrides the glow effect if set
<details>
<summary>Example &mdash; Changing player's team color</summary>
```java
player.sendPluginMessage(plugin, "velocitab:update_team_color", "a".getBytes());
```
</details>