Skip to main content

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

OptionTypeDefaultDescription
enabledbooleanfalseEnable/disable the feature
countdown-timeinteger60Default countdown duration in seconds
countdown-announcementslist[300, 120, ...]Seconds at which to show countdown warnings
notification-typeslist[chat, bossbar]Types of notifications to show
bossbar-colorstringREDBossBar color (RED, BLUE, GREEN, YELLOW, PURPLE, PINK, WHITE)
timezonestring""Timezone for scheduled restarts (empty = server default)
scheduled-restarts-enabledbooleanfalseEnable automatic scheduled restarts
scheduled-timeslist["04:00:00"]List of scheduled restart times
execute-pre-commandsbooleantrueRun pre-restart commands before shutdown
pre-restart-commandslist["save-all"]Commands to run before restart

Notification Types

You can enable multiple notification types simultaneously:

TypeDescription
chatBroadcast message in chat (only at announcement times)
actionbarPersistent message above hotbar (every second)
bossbarProgress bar at top of screen (updates every second)
titleLarge 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:

  1. Opening the main menu (/smp menu)
  2. Finding the Server Restart feature (clock icon)
  3. Right-click to open settings

Main Settings GUI

SlotItemFunction
10Redstone BlockRestart Now - Shift+Click to confirm immediate restart
12ClockStart Countdown - Left-click for default time, right-click for custom
14BarrierCancel Restart - Stop active countdown
16Command BlockScheduled Restarts - Open schedule management
28BellNotification Types - Cycle through notification options
30CompassCountdown Time - Adjust default countdown duration
32Command BlockPre-Restart Commands - Toggle command execution
34DyeBossBar Color - Cycle through colors
40ArrowBack - Return to main menu

Schedule Management GUI

SlotItemFunction
4Lime/Gray DyeToggle Scheduled Restarts - Enable/disable scheduling
19-25PaperSchedule Entries - Shift+Click to remove
36ArrowBack - Return to restart settings
40EmeraldAdd 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

PermissionDescriptionDefault
smp.menuAccess main menu (required for restart GUI)op

How It Works

Countdown Process

  1. 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)
  2. 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-time to start the countdown before the scheduled time
  • For example: if scheduled for 04:00:00 with 60s countdown, countdown starts at 03: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