import java.util.UUID;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.event.ProxyPingEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
public class MOTD implements Listener {
@EventHandler
public void onPing(ProxyPingEvent e) {
ServerPing ping = e.getResponse();
ServerPing.Players player = ping.getPlayers();
ServerPing.Protocol vers = ping.getVersion();
vers.setName("§4 Test");
e.getResponse().setVersion(new ServerPing.Protocol( "some random text", 2));
player.setSample(new ServerPing.PlayerInfo[] {new ServerPing.PlayerInfo("here is some text aswell.", UUID.randomUUID()) });
ping.setDescription("and a whole ton of randomt text here");
e.setResponse(ping);
Thats my Code so far. And in the screenshot you will the results. But i dont want the red "x" with the client out of Date Message. I want the online thingy with my own Text. Any ideas? #(if i hover the "text" i see my own text, but if i hover the "ping" i get the OutofDate message.)
Here's fixed code with comments:
@EventHandler
public void onPing(ProxyPingEvent e) {
ServerPing ping = e.getResponse();
ServerPing.Players player = ping.getPlayers();
ServerPing.Protocol vers = ping.getVersion();
// change version text, but dont change version protocol id
// because that causes the RED X in server browser
vers.setName("Some version text");
player.setSample(new ServerPing.PlayerInfo[] {
new ServerPing.PlayerInfo("here is some text aswell.", UUID.randomUUID())
});
ping.setDescription("and a whole ton of randomt text here");
e.setResponse(ping);
}