How to make a plugin to restart server when MiniGame is over?

Discussion in 'BungeeCord Plugin Development' started by Aditya, Jul 6, 2015.

  1. Hey there, I can't find much free BungeeCord MiniGames except MGLib which is inactive now so I want to use other plugins available but I don't know that how I can kick all players and send them to the Lobby server and then restart the server. Anyone who can tell me how I can do that?
  2. you need then to use it bukkit side by creating a command like tp2hub and that sends the player to the hub and it should then execute the shutdown

    Code (Text):

  3. Uhm but how would I know if the minigame has ended??
  4. You should know when your mini-game ends... your creating the mini-game?
  5. I am not creating the minigame that's the problem. I tried using MGLib but It's documentation ain't nice and I have never coded minigames.
  6. Looking for the same thing, I currently use bukkit.shutdown(), need a restart.
  7. This section is dedicated to Bungee plugin development. Try asking your question here.
  8. He stated he wants to kick all the players to lobby & restart the server.
  9. I'm assuming you want this:

    -Create a minigame on your Bukkit server
    -Know when that minigame plugin ends it's game
    -Send everyone back to the hub
    -and restart that server
    That's how I understood it. In that case, I would do it like this

    Assuming of course that somewhere in the documentation you can find an event which is called when the minigame ends, you could create a bukkit-side plugin that has the minigame as a dependency so you can import the event, and then listen for that event and send a plugin message back to your bungeecord server where you have another bungeecord plugin listening for that message. Send everyone to the lobby, then send a response to the bukkit plugin which restarts the server?

    Might be a bit over-kill, but it's all I can think of. Otherwise you could try figure out the best way to loop through everyone and have them run the /server [hub server] command, but that's then a Bukkit plugin and better suited for their sub-forum. Good luck!
  10. Thanks for the solution. I would try it and maybe get it to work.
  11. you can do this feature in a lot of ways it depends on the plugin if ur using bungee or multiverse etc
  12. I use Bungee!
  13. Everyone is saying to create a /hub or /lobby command and force the player to execute it on game over. Why don't you just use a connection loss event handler in BungeeCord and redirect the player to the main hub/lobby when the event occurs.
  14. Problem is that I don't code minigames and I use public plugins! I wanna implement them in my custom plugins so it does that...