Configuration
On this page(2)
SnAutoRestart ships with the following YAML files. New keys are auto-merged on boot; your edits and comments are preserved.
config.yml
# ============================================================
# SnAutoRestart - configuration
# Managed by SnLib: new keys are auto-merged on boot; your values and
# comments are preserved. Do NOT add a config-version key (retired).
# Set update-configs: false to freeze this file (SnLib only warns about
# missing keys instead of inserting them).
# Sections marked "# sn:extensible" are yours: entries you delete there
# stay deleted.
# ============================================================
# Active language code; loads lang/messages_<code>.yml (falls back to en).
lang: en
# Master switch of the SnLib auto-updater for this plugin's managed files.
update-configs: true
# Runtime debug output (also toggleable live via /snautorestart debug).
debug:
# Master toggle of the debug output.
enabled: false
# Verbosity threshold: OFF, INFO, DEBUG or TRACE.
level: DEBUG
# Category filter; an empty list lets every category through.
categories: []
# ------------------------------------------------------------
# Main command.
# ------------------------------------------------------------
command:
# Aliases of /snautorestart. Re-read on /snautorestart reload.
aliases: [sar, autorestart]
# ------------------------------------------------------------
# Public developer API.
# ------------------------------------------------------------
# Public developer API events. When false, no API event is dispatched (zero
# cost) and cancellable hooks report "not cancelled" so commands proceed.
# The query facade stays available either way.
api-events:
enabled: true
# ------------------------------------------------------------
# Model. When the server restarts and how it shuts down.
# ------------------------------------------------------------
# Restart schedule.
schedule:
# Time zone of the restart times: "system" or a Java ZoneId such as America/New_York.
timezone: system
# Skips a scheduled restart when the server has been up for less than this; 0 turns the guard off.
min-uptime: 10m
# Restart times, one per entry: a 5-field cron expression, "daily HH:mm" or "hourly :mm".
restarts:
- "daily 09:00"
# Shutdown at the end of a countdown.
shutdown:
# stop calls Bukkit.shutdown(); restart runs the Spigot restart script.
method: stop
# ------------------------------------------------------------
# Features. The countdown and the closing sequence before a restart.
# ------------------------------------------------------------
# Restart countdown.
countdown:
# Length of a forced restart when /snautorestart restart is given no time.
force-default: 60s
# Seconds before the restart at which an announcement is sent.
announce-at: [300, 60, 30, 10, 5, 3, 2, 1]
# Lockdown: blocks player actions shortly before the restart.
lockdown:
# Seconds before the restart at which the lockdown starts; 0 disables the automatic lockdown.
before-restart: 60
# Blocks chat messages during the lockdown.
block-chat: true
# Blocks commands during the lockdown, except the allowed ones.
block-commands: true
# Extra base command names, without slash, that still work during the lockdown.
# /snautorestart and its command.aliases always work.
allowed-commands: [snautorestart, sar, autorestart]
# Seconds between two "blocked" notices sent to the same player. 0 sends a notice for every
# blocked action (no throttle); a negative value falls back to 1.5; the maximum is 3600.
notice-cooldown: 1.5
# Join lock: refuses logins around the restart.
join-lock:
# Seconds before the restart from which logins are refused; 0 disables it.
before-restart: 50
# Seconds after the server starts during which logins are refused; 0 disables it.
after-boot: 30
# Kick of the online players before the shutdown.
kick:
# Seconds before the restart at which every online player is kicked; 0 disables it.
before-restart: 20
# Console commands run before the restart: "[time:X] command" runs X seconds before it, with no tag it runs at T-0 right before the shutdown.
pre-restart-commands:
- "[time:40] save-all"
# Console commands run after every boot: "[time:X] command" runs X seconds after the server starts.
post-restart-commands: []
# ------------------------------------------------------------
# Integrations. PlaceholderAPI and command output.
# ------------------------------------------------------------
# Placeholders and /snautorestart time.
placeholders:
# DateTimeFormatter pattern of the next restart time.
next-restart-format: "HH:mm"
# ------------------------------------------------------------
# Feedback. What players are told during a countdown.
# ------------------------------------------------------------
# Countdown announcement channels.
announcements:
# Sends the announcements in chat.
chat: true
# Shows the announcements as a title.
title: true
# Shows the announcements in the action bar.
actionbar: false
# Boss bar that follows the countdown.
bossbar:
# Turns the boss bar on.
enabled: false
# Boss bar color: PINK, BLUE, RED, GREEN, YELLOW, PURPLE or WHITE.
color: RED
# Boss bar style: PROGRESS, NOTCHED_6, NOTCHED_10, NOTCHED_12 or NOTCHED_20.
overlay: PROGRESS
# Sound played with every announcement.
sound:
# Turns the sound on.
enabled: true
# Sound to play, in the form SOUND [volume] [pitch].
sound: "BLOCK_NOTE_BLOCK_PLING 1 1"
# Server-wide broadcasts about restart events.
broadcasts:
# Broadcasts when an admin forces a restart.
forced: true
# Broadcasts when a countdown is cancelled.
cancelled: true
# Broadcasts when the lockdown turns on or off.
lockdown: truelang/messages_en.yml
# ============================================================
# SnAutoRestart - language file (English)
# Managed by SnLib: new keys merge in on boot, your values are kept.
# Restyle any line freely; your edits survive updates.
# ============================================================
# Prefix prepended to every single-line message sent via sn.lang().send(...)
prefix: "₢f2&lSnAutoRestart &8| &7"
# snlib.* is SnLib's shared command contract (14 keys; the two help.group-*
# keys exist since SnLib 1.36.0). Every Sn plugin ships
# this block UNCHANGED: SnLib bundles NEUTRAL defaults for any key you omit and
# merges them in on boot, so an incomplete block leaks unbranded lines. Shipping
# the FULL block is what keeps the whole fleet visually identical. Placeholders
# {plugin} {usage} {description} {page} {total} {min} {max} {value} {command}
# {group} {path} are filled by SnLib. NEVER put {prefix} here (it is auto-prepended).
snlib:
no-permission: "&cYou do not have permission to use this command."
usage: "&cUsage: &e{usage}"
invalid-number: "&cInvalid number: &e{value}"
invalid-value: "&cInvalid value: &e{value}"
out-of-range: "&cValue must be between &e{min} &cand &e{max}&c: &e{value}"
number-too-small: "&cValue must be at least &e{min}&c: &e{value}"
player-not-found: "&cPlayer not found: &e{value}"
unknown-subcommand: "&cUnknown subcommand: &e{value}"
reload-done: "&aConfiguration reloaded."
help:
header: "&8&m----------&r ₢f2&l{plugin} &8&m----------"
# Branded no-separator form. SnLib's neutral default is "&e{usage} &7{description}".
entry: "₢f2{usage} &7{description}"
footer: "&7Page &f{page}&7/&f{total} &8- ₢f2/{command} help <page>"
# Own help of a groupHelp() command group (/<cmd> admin <module> help).
group-header: "&8&m----------&r ₢f2&l{group} &8&m----------"
group-footer: "&7Page &f{page}&7/&f{total} &8- ₢f2{path} help <page>"
# Short state words returned by the PlaceholderAPI placeholders; a restyle here applies to all of them.
status:
# Lockdown state.
lockdown-on: "&cActive"
lockdown-off: "&aInactive"
# Stand-in for a value that does not exist, such as the time left with no countdown running.
none: "None"
# Restart countdown state.
countdown-active: "&cRunning"
countdown-idle: "&7Idle"
# Unit words of every formatted duration (countdown messages, placeholders). {value} is the
# amount of the unit; zero units are left out and a zero duration is shown in seconds.
time-format:
hours: "{value}h"
minutes: "{value}m"
seconds: "{value}s"
# Text placed between two units.
separator: " "
# Your own plugin messages. Do NOT write {prefix} in any value: SnLib
# auto-prepends the prefix above to every single-line message sent via
# sn.lang().send(...).
# Each feature area owns one subsection: lockdown, countdown, broadcast, join-lock, kick, command.
messages:
lockdown:
# Sent to a player whose action the lockdown blocked (at most once per lockdown.notice-cooldown).
blocked: "&cThe server is about to restart: this action is locked."
countdown:
# Chat announcement of every announce point. {time} is the time left until the restart.
chat:
- ""
- "&c&lRESTART &7&l» &fRestarting in &c{time}&f!"
- ""
# Title announcement of every announce point: title;subtitle;fadeIn;stay;fadeOut (times in ticks).
title: "&c&lRESTART;&fRestarting in &c{time}&f!;0;25;5"
# Action bar announcement of every announce point.
actionbar: "&c&lRESTART &7&l» &fRestarting in &c{time}&f!"
# Boss bar text, refreshed every second while the countdown runs.
bossbar: "&c&lRESTART &7&l» &fRestarting in &c{time}"
broadcast:
# Sent when an admin forces a restart. {time} is the length of the countdown.
forced: "&cAn administrator started a server restart in &f{time}&c."
# Sent when a running countdown is cancelled.
cancelled: "&aThe server restart was cancelled."
# Sent when the lockdown turns on.
lockdown-on: "&cServer lockdown enabled: interactions are blocked."
# Sent when the lockdown turns off.
lockdown-off: "&aServer lockdown disabled."
join-lock:
# Kick screen of a login refused while the restart is about to happen. A list shows one line per entry.
restarting: "&cThe server is restarting. Please try again in a minute."
# Kick screen of a login refused while the server has just started.
starting: "&eThe server is still starting. Please try again in a few seconds."
kick:
# Kick screen shown to every online player at kick.before-restart. A list shows one line per entry.
reason:
- "&c&lSERVER RESTARTING"
- ""
- "&7The server is restarting. Please reconnect in a minute."
command:
# /<cmd> time while a countdown runs. {time} is the time left, {at} the restart time.
time-running: "&7The server restarts in &f{time}&7 (at &f{at}&7)."
# /<cmd> time with no countdown running. {at} is the next scheduled restart, {time} the time until it.
time-next: "&7No countdown is running. Next restart at &f{at}&7, in &f{time}&7."
# /<cmd> time when no countdown runs and nothing is scheduled.
time-none: "&7No restart is scheduled."
# /<cmd> restart confirmation. {time} is the countdown length.
restart-started: "&aRestart countdown started: &f{time}&a."
# /<cmd> restart confirmation when it replaced a running countdown. {time} is the new length.
restart-replaced: "&aThe running countdown was replaced. The server restarts in &f{time}&a."
# /<cmd> restart with more than one word after it ("5 minutes"). {label} is the command the sender typed.
restart-bad-time: "&cGive the restart time as a single word, for example &f/{label} restart 5m&c or &f/{label} restart 1h30m&c."
# /<cmd> restart with a time under one second. {label} is the command the sender typed.
restart-too-short: "&cThe restart time must be at least 1 second, for example &f/{label} restart 30s&c."
# /<cmd> restart without a time when countdown.force-default is under one second.
restart-default-too-short: "&cThe default countdown (countdown.force-default) is under 1 second. Give a time: &f/{label} restart 30s&c."
# /<cmd> restart when the countdown could not start (the server is already shutting down, or the time is out of range).
restart-refused: "&cThe restart could not be started: the server is already shutting down or the time is out of range."
# /<cmd> cancel confirmation.
cancel-done: "&aThe restart countdown was cancelled."
# /<cmd> cancel with no countdown running.
cancel-none: "&cThere is no restart countdown to cancel."
# /<cmd> cancel once the server already started shutting down.
cancel-too-late: "&cThe server is already shutting down: the restart can no longer be cancelled."
# /<cmd> lockdown on confirmation. {label} is the command the sender typed.
lockdown-on: "&aThe lockdown is now on. Release it with &f/{label} lockdown off&a."
# /<cmd> lockdown off confirmation.
lockdown-off: "&aThe lockdown is now off."
# /<cmd> lockdown on while the manual lockdown is already on.
lockdown-already-on: "&eThe manual lockdown is already on."
# /<cmd> lockdown off while the manual lockdown is already off and nothing else holds it.
lockdown-already-off: "&eThe lockdown is already off."
# /<cmd> lockdown off while the restart countdown still holds a lockdown. {label} is the command the sender typed.
lockdown-restart-held: "&eThe manual lockdown is off, but the restart lockdown stays on until the countdown ends or is cancelled (&f/{label} cancel&e)."
# /<cmd> restart, cancel or lockdown when another plugin blocked the action through the developer API.
api-cancelled: "&cAnother plugin blocked this action."