You can use the ServerInfo object to get a list of players connected to a specific server, even if that server is not connected to the proxy.
ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo("server_name"); // replace "server_name" with the name of the server you want to query
if...
It looks like you're trying to replace a piece of text in the chat message with the player's level, using the replaceText method from the Component class. However, it's not clear from your code snippet what exactly is not working.
One issue with your code is that you're using the AsyncChatEvent...
Have you seen a plugin called Citizens?
This might help, you'll be able to look at the source code and see how its done also here!
https://github.com/CitizensDev/Citizens2
Hope this helps :)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.