KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
706 stars 107 forks source link

Is there a way to get Component through the player? #921

Closed xLikeWATCHDOG closed 1 year ago

xLikeWATCHDOG commented 1 year ago

In order to popularize translation in my plugin, I used the Gui library (Triumph GUI) that uses the Adventure library when designing the Gui interface. One of the reasons is that I'm going to support the 1.8.8 server, and another reason is that I need to go to Compent for the translation operation. For example

translatable().key("floracore.command.report.abnormal")

Then, I found that when I built it directly to Compent and then set it to title. image I found that it sets the title directly like this. Legacy.SERIALIZER.serialize(title) Then it returns floracore.command.report.abnormal directly in the menu So, what I'm trying to say is that I want to get the processed Compent directly through the player (Sender). How should I do that? Also, I would like to know how I can get Compent to get the processed String through the player (Sender). If this is not possible, it also means that my Gui must use the source language and cannot be multilingual. So that's really important to me. Because I don't seem to see a similar operation in the documentation. Please help me! Thanks!

xLikeWATCHDOG commented 1 year ago

image