[SPIGOT-6223] Ability to set BaseComponent/JSON as Prefix/Suffix for Scoreboard Team Created: 07/Nov/20 Updated: 31/Aug/22 |
|
Status: | Open |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Sasha Sorokin | Assignee: | Parker Hawke |
Resolution: | Unresolved | Votes: | 2 |
Labels: | api | ||
Environment: |
Windows 10 running OpenJDK 1.8.0_272-b10 (openj9-0.23.0) |
Attachments: |
![]() |
Version: | git-Spigot-57bbdd8-dea4138 (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
Minecraft allows prefixes, suffixes, objective titles to be in raw JSON format (except the ones requiring resolution), what can be tested by running these commands:
/team add example_team {"text":"Unreal Team", "color": "#e7edc5"} /team modify example_team prefix { "text": "[Unreal Team] ", "color": "#e7edc5" } /team join example_team PlayerName /scoreboard objectives add objective dummy { "text": "S C O R E B O A R D", "bold": true, "italic": true, "color": "#e19fb9" } /scoreboard objectives setdisplay sidebar objective /scoreboard players set PlayerName objective 420 Which would display the following scoreboard on screen:
{{net.md_5.bungee.api.chat.* }}contains helpful classes to format text into this format. It makes sense you could use these classes (or at least their serialised values) with methods
Allowing this gives plugin creators simple ability to not only format texts (which already can be done using ChatColors API) but more valuable use client-side rendered texts, such as localised strings and keyboard shortcuts.
|