Cancel ServerListPingEvent

Discussion in 'Spigot Plugin Development' started by DotRar, May 23, 2015.

  1. Hey, anyone know a way to cancel a response in ServerListPingEvent?
     
  2. It's not possible without actually modifying code to do this safely, though I assume sending a corrupted MOTD and cancelling the ping might cause the client to display the server as offline.
     
  3. How would I create these?
     
  4. I just tested and it seems passing in a null MOTD will cause the server to appear offline. Players can still connect to it though~

    Oh, and it will display a short 1-line error message in the console each time the server is pinged and returns the null MOTD xD
     
  5. Then kick on login ;)
     
    • Winner Winner x 1
  6. Get the connection and disconnect it..?
     
  7. How do I do that? I'm currently learning more about connections and sockets ect.
     
  8. PlayerLoginEvent event.disAllow()