Server Restart
Schedule automatic restarts and let players know before the server goes down.
Overview
The Server Restart feature lets you schedule and announce restarts in-game. You can trigger an immediate restart, run a countdown with warnings, set up automatic daily schedules, and choose how players are notified (chat, action bar, boss bar, title, or any combination). Pre-restart commands like save-all run automatically before shutdown.
Configuration
features:
server-restart:
enabled: false
countdown-time: 60
countdown-announcements:
- 300
- 120
- 60
- 30
- 10
- 5
- 4
- 3
- 2
- 1
notification-types:
- chat
- bossbar
bossbar-color: RED
timezone: ""
scheduled-restarts-enabled: false
scheduled-times:
- "04:00:00"
execute-pre-commands: true
pre-restart-commands:
- "save-all"
sound:
enabled: true
sound: "BLOCK_NOTE_BLOCK_PLING"
volume: 1.0
pitch: 1.0
messages:
countdown-message: "§c⚠ Server restarting in §e{time} §cseconds!"
actionbar-message: "§cRestarting in {time}s"
bossbar-message: "§cServer Restart: {time}s"
title-message: "§c⚠ Server Restart"
subtitle-message: "§e{time} seconds remaining"
restart-now-message: "§c⚠ Server restart initiated by {player}!"
restart-done-message: "§c⚠ Server is restarting now!"
cancelled-message: "§a✔ Server restart has been cancelled."
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable/disable the feature |
countdown-time | integer | 60 | Default countdown duration in seconds |
countdown-announcements | list | [300, 120, ...] | Seconds at which to show countdown warnings |
notification-types | list | [chat, bossbar] | Types of notifications to show |
bossbar-color | string | RED | BossBar color (RED, BLUE, GREEN, YELLOW, PURPLE, PINK, WHITE) |
timezone | string | "" | Timezone for scheduled restarts (empty = server default) |
scheduled-restarts-enabled | boolean | false | Enable automatic scheduled restarts |
scheduled-times | list | ["04:00:00"] | List of scheduled restart times |
execute-pre-commands | boolean | true | Run pre-restart commands before shutdown |
pre-restart-commands | list | ["save-all"] | Commands to run before restart |
Notification Types
You can enable multiple notification types simultaneously:
| Type | Description |
|---|---|
chat | Broadcast message in chat (only at announcement times) |
actionbar | Persistent message above hotbar (every second) |
bossbar | Progress bar at top of screen (updates every second) |
title | Large centered text (only at announcement times) |
Schedule Formats
The server restart supports three schedule formats:
Daily Restart
scheduled-times:
- "04:00:00" # Every day at 4:00 AM
- "16:00:00" # Every day at 4:00 PM
Weekly Restart
scheduled-times:
- "SUN 03:00:00" # Every Sunday at 3:00 AM
- "WED 04:00:00" # Every Wednesday at 4:00 AM
Supported days: MON, TUE, WED, THU, FRI, SAT, SUN
One-Time Restart
scheduled-times:
- "2024-12-25 06:00:00" # Christmas Day at 6:00 AM
You can mix different formats:
scheduled-times:
- "04:00:00" # Daily at 4 AM
- "SUN 02:00:00" # Extra restart on Sundays
- "2024-12-31 23:59:00" # New Year's Eve
GUI Configuration
Access the Server Restart GUI by:
- Opening the main menu (
/smp menu) - Finding the Server Restart feature (clock icon)
- Right-click to open settings
Main Settings GUI
| Slot | Item | Function |
|---|---|---|
| 10 | Redstone Block | Restart Now - Shift+Click to confirm immediate restart |
| 12 | Clock | Start Countdown - Left-click for default time, right-click for custom |
| 14 | Barrier | Cancel Restart - Stop active countdown |
| 16 | Command Block | Scheduled Restarts - Open schedule management |
| 28 | Bell | Notification Types - Cycle through notification options |
| 30 | Compass | Countdown Time - Adjust default countdown duration |
| 32 | Command Block | Pre-Restart Commands - Toggle command execution |
| 34 | Dye | BossBar Color - Cycle through colors |
| 40 | Arrow | Back - Return to main menu |
Schedule Management GUI
| Slot | Item | Function |
|---|---|---|
| 4 | Lime/Gray Dye | Toggle Scheduled Restarts - Enable/disable scheduling |
| 19-25 | Paper | Schedule Entries - Shift+Click to remove |
| 36 | Arrow | Back - Return to restart settings |
| 40 | Emerald | Add Schedule - Add new schedule via chat |
Commands
The Server Restart feature integrates with the main menu and doesn't have standalone commands. Use the GUI for all configuration.
Permissions
| Permission | Description | Default |
|---|---|---|
smp.menu | Access main menu (required for restart GUI) | op |
How It Works
Countdown Process
-
When a countdown starts (manually or scheduled):
- A background task runs every second
- At announcement times, notifications are sent based on enabled types
- BossBar progress decreases as time passes
- Warning sounds play at announcement times (if enabled)
-
When countdown reaches 0:
- Pre-restart commands execute (if enabled)
- Final "restarting now" message broadcasts
- Server shuts down
Scheduled Restart Detection
The plugin checks every second if a scheduled restart time has been reached:
- The check accounts for
countdown-timeto start the countdown before the scheduled time - For example: if scheduled for
04:00:00with 60s countdown, countdown starts at03:59:00
Configuration Examples
Standard Setup
features:
server-restart:
enabled: true
countdown-time: 300 # 5 minute warning
countdown-announcements:
- 300
- 180
- 120
- 60
- 30
- 10
- 5
- 4
- 3
- 2
- 1
notification-types:
- chat
- bossbar
- title
bossbar-color: RED
scheduled-restarts-enabled: true
scheduled-times:
- "06:00:00" # Morning restart
- "18:00:00" # Evening restart
execute-pre-commands: true
pre-restart-commands:
- "save-all"
- "broadcast §eSaving world data..."
Example Use Cases
PvP Server (Frequent Restarts)
scheduled-times:
- "00:00:00"
- "06:00:00"
- "12:00:00"
- "18:00:00"
countdown-time: 120 # 2 minute warning
Survival Server (Minimal Disruption)
scheduled-times:
- "04:00:00" # Once daily at low-traffic time
countdown-time: 600 # 10 minute warning
Event Server (Manual Control Only)
scheduled-restarts-enabled: false
# Use GUI to manually trigger restarts as needed