ShutdownNotice
Description
Start a timer and notify your online users before shutting the server down. The notice repeats so often until the task is cancelled or til the timer hits 0 at which the server will automatically shutdown. Simply use this plugin instead of /stop to shutdown your server and the plugin will take care of the rest.
There is auto-restart support when using a compatible startup script (examples provided below). When you start the server using a compatible restart script the server will auto restart when using the /restart or /reboot aliased commands.
The server list ping motd can also optionally be overridden to display any shutdown notifications.
Everything is configurable, from the broadcast messages, to the notice times, to the pre-shutdown commands to automatically perform.
Enjoy! ^_^
Sorry about the funky recording. :S
Commands
/shutdown [time (reason) | cancel] Shutdown the server after a delay. (Aliases: restart, reboot)
Permissions
command.shutdown Allow player to use /shutdown command.
Config.yml
Version 2.0
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Enable debug info in console debug-mode: false # Enable colors in console output color-logs: true # Update the server list ping MOTD to show when server is scheduled for shutdown/restart update-ping-motd: true # Commands to perform just before the server shuts down shutdown-commands: - say Goodbye. - kickall |
Example Auto-Restart Startup Scripts
For Linux (start.sh):
1 2 3 4 5 6 7 8 9 10 11 | #!/bin/sh while $RELOAD do RELOAD=false java -Xmx4096M -Xms1024M -jar spigot-1.8.3.jar -o true if [ -f plugins/ShutdownNotice/restart ]; then RELOAD=true echo "Restarting server in 5 seconds..." sleep 5 fi done |
For Windows (start.bat) untested:
1 2 3 4 5 6 7 8 9 | @echo off :start java -Xmx4096M -Xms1024M -XX:MaxPermSize=128M -jar spigot-1.8.3.jar -o true if exists plugins\ShutdownNotice\restart ( echo "Restarting server in 5 seconds..." timeout /t 5 /nobreak > NUL goto start ) pause |
As you can see, the script simply has to check for the "restart" file in the plugin's directory and perform a restart when one is found. Simple.
Todo
- Add variable broadcast delay (you set how often to send title/chat broadcasts)
- Implement real time schedules (For example: Restart server every night at midnight. Etc)
Have a suggestion? Leave a comment!
Metrics
This plugin uses metrics to collect stats! It only collect basic things such as version type, and players online. If you want to see everything, click on the graph. Go into /plugins/PluginMetrics/config.yml to disable stat collecting if you wish.
Can only seem to get this to work from console. In game commands and permissions dont seem to work for 1.6.4 server at this moment......
Issue:
[00:40:21] [Server thread/WARN]: java.lang.NoSuchMethodException: net.minecraft.server.v1_14_R1.PacketPlayOutChat.<init>(net.minecraft.server.v1_14_R1.IChatBaseComponent, byte)
[00:40:21] [Server thread/WARN]: at java.lang.Class.getConstructor0(Unknown Source)
[00:40:21] [Server thread/WARN]: at java.lang.Class.getConstructor(Unknown Source)
[00:40:21] [Server thread/WARN]: at net.pl3x.bukkit.shutdownnotice.ActionBar.send(ActionBar.java:22)
[00:40:21] [Server thread/WARN]: at java.lang.Iterable.forEach(Unknown Source)
[00:40:21] [Server thread/WARN]: at java.util.Collections$UnmodifiableCollection.forEach(Unknown Source)
[00:40:21] [Server thread/WARN]: at net.pl3x.bukkit.shutdownnotice.ActionBar.broadcast(ActionBar.java:37)
[00:40:21] [Server thread/WARN]: at net.pl3x.bukkit.shutdownnotice.task.Countdown.run(Countdown.java:89)
[00:40:21] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftTask.run(CraftTask.java:81)
[00:40:21] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:394)
[00:40:21] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.b(MinecraftServer.java:1023)
[00:40:21] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.DedicatedServer.b(DedicatedServer.java:396)
[00:40:21] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:971)
[00:40:21] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:816)
[00:40:21] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)
[00:40:22] [Server thread/WARN]: java.lang.NoSuchMethodException: net.minecraft.server.v1_14_R1.PacketPlayOutChat.<init>(net.minecraft.server.v1_14_R1.IChatBaseComponent, byte)
why is this coming out every second when i /shutdown (600 or over 10 mins)
how to solve it??
im using version 1.14.4
@XxDawnsusxX
Are you using version 2.1 or 2.8? This site is actually out of date. You may want to try the latest version of the plugin. found here.
@XxDawnsusxX
The latest version doesnt work at all, the older versions do but.
Is there a tutorial on how this works?
Really useful, thanks! :-)
Updated to
v2.0v2.1Major changes (see changelog in download area).
Biggest change: Legacy server versions are no longer supported. Only the latest CraftBukkit and Spigot builds will be supported starting with v2.0. At the time of this post that version is 1.8.3.
v2.0 was removed due to bugs.
This would be very awesome if it included restarts or reboots on a timer. For instance I would love my server to reboot every 12 hours, and I love the scoreboard features on this one. I just am not always available every 12 hours to hop online and reboot a handful of servers.
Side question- Do the newest updates work backwards? Aka can I plug the 1.7 version into my 1.5 Hexxit server?
Uploaded v1.6 (Jenkins Build #15)
Fixed:
Added:
Other:
Uploaded v1.5 Jenkins Build #10
Fixed:
Added: none
Uploaded v1.4 Jenkins Build #8
Fixed: none
Added:
@NEWexlasis
It does not, but that's not a bad idea. I'll have a look at scoreboards to see if they are a viable option for displaying the countdown timer.
does this use scoreboards?
Uploaded v1.3 Jenkins Build #6 Fixed:
Please upgrade to this version as soon as possible as v1.2 will not shutdown your server when the timer hits 0!
Uploaded v1.2 Jenkins Build #5
Fixed:
Added:
Uploaded v1.1
Fixed: