javaminecraftbungeecord

Dynamically change BungeeCord server configuration


I'm setting up a new Minecraft Server and I want to change my sub-servers using my own Plugin.

This doesnt work

getProxy().getServers().put("game25568", new ServerInfo());

How can I add a server with a custom address and motd?


Solution

  • I think this is what you want :)

    https://www.spigotmc.org/threads/registering-server.51340/#post-576590

    By Spawl - on SpigotMC

    ServerInfo info = ProxyServer.getInstance().constructServerInfo(id, InetSocketAddress.createUnresolved(ip, port), "motd here", restricted);
    ProxyServer.getInstance().getServers().put(id, info);