How to make a minecraft server restart automatically

HOW TO SETUP AUTOMATIC SCHEDULED RESTARTS
  1. On your Multicraft panel, navigate to Advanced > Scheduled Tasks.
  2. On the Scheduled Tasks page, click on New Task.
  3. On the New Task page, fill out the necessary entries based on how often you want your server to restart, when/what time, and more.

Collectives™ on Stack Overflow

Collaborate using centralized, reliable content and the technologies you use most.

Teams

Connect and exchange knowledge in a single, structured, searchable location.

Although the technical question in this case is outside the purview of standard Minecraft support, I am currently the server administrator on a private Minecraft server.

Despite my lack of batch experience and a cursory google search turning up nothing useful, I want the batch file that launches the server to restart at 12 am and 12 pm.

Due to my limited knowledge of batch functions, I am at a loss as to whether batch CAN execute commands within a java server console, send the commands to save the server and then exit, and restart itself.

I want the batch file to restart itself after running a command in the server window for either 43200 seconds or once every 12 seconds. I have no idea how to make a batch file execute a command from the server command line or even if that is even possible.

The current batch code is as follows:

Any help would be aprreciated. Thanks.

3 Answers 3
Sorted by:

I use this, but if you want it to restart itself without your intervention, remove the “choose” part and create a loop from start to restart instead.

ps. replace minecraft_server.1.8.3.jar with the name of your server file

Solution 1: I would advise using a batch file instead of the Windows task scheduler. There, you can add any cmd command you want to be executed alongside a task you want to create, schedule to be triggered at 12 a.m. or 12 p.m. However, communicating with the server console without being familiar with its particular interface or how to manage a Minecraft server is not easy. Simply kill the server and restart it using the command line is what you can do.

Solution 2: If you dont like this solution and dont know how to communicate with the server console you can try this: Take a look at AutoIt (https://www.autoitscript.com/site/). Its a VERY simple script language which also can simulate click and input from the keyboard. So you can write a script that sets the focus to your server console and types the desired command to restart the server. This AutoIt script can be compiled to an exe file or you can run it as an au3 script. You should still use the task scheduler to run your exe/script at 12am/pm.

I can assist you with writing the AutoIt script if you need some assistance.

Here is the script I used to create a similar program in AutoIt for a friend, and I’ve highlighted the lines that need configuration:

The hotkeys can be used to easily control the program even if you don’t need to (remote desktop).

You can use a online compiler like (http://www.script-example.com/themen/AutoIT-Online-Compiler.php) or download it from (https://www.autoitscript.com/site/) hope i could help if any further questions with the code ask me.

Copy and paste this URL into your RSS reader to sign up for this RSS feed.

By selecting “Accept all cookies,” you consent that Stack Exchange may put cookies on your computer and share information with third parties in accordance with our cookie policy.

Minecraft Auto-Restart Plugin | Minecraft Plugins

FAQ

How do I make automatic server restart?

Choose the application server you want to automatically restart, then select Java and process management under Server Infrastructure. Select Automatic restart. To directly save the change to the master configuration, click Apply, then Save.

Is there a Minecraft plugin to restart a server?

Description. A Bukkit (a Minecraft server wrapper) plugin called SimpleRestart enables server operators to quickly and easily restart their servers as well as set up periodic automatic restarts “for freshness.”

How do you restart a Minecraft server using commands?

What you should do is going into your spigot. Editing the “restart script” line from restart in the yml file [I hope you are using Spigot/Paper] sh to yourstartupscript. then restart your server with sh/bat [sh for Linux, bat for Windows]. Doing this should make /restart work.

How do you restart a server?

Click Start, Run from your task bar to restart a computer or server. Enter services. msc. Browse for SQL server. Right-click SQL Server and select Properties. Select Automatic for the Startup type.

Leave a Comment