Skip to main content
poplock_datapack.zip provides a single Minecraft function — poplock:alert — that plays a sound alert to all online players simultaneously. The snapshot script calls this function at each countdown interval before stopping the server for a daily snapshot.

Countdown intervals

When the server is online at snapshot time, snapshot.sh broadcasts a message and triggers poplock:alert at the following intervals before shutdown:
Time before shutdownBroadcast message
30 minutesServer will go down for a daily snapshot in 30 minutes.
15 minutesServer will go down for a daily snapshot in 15 minutes.
10 minutesServer will go down for a daily snapshot in 10 minutes.
5 minutesServer will go down for a daily snapshot in 5 minutes.
1 minuteServer will go down for a daily snapshot in 1 minute!
30 secondsServer going down for snapshot in 30 seconds! Please log off now.
15 secondsServer going down for snapshot in 15 seconds!
5 secondsServer going down for snapshot in 5 seconds!
The datapack function is used instead of a direct playsound command so that the per-player command feedback messages are suppressed in chat.

Installation

1

Download the datapack

sudo wget -O /usr/local/games/minecraft_server/java/world/datapacks/poplock_datapack.zip \
  https://github.com/Scyne/PopLockRP/raw/refs/heads/main/poplock_datapack.zip
The world/datapacks/ directory is created by the server on its first run. If you are installing the datapack before the server has launched for the first time, create the directory manually first:
mkdir -p /usr/local/games/minecraft_server/java/world/datapacks
2

Activate the datapack from the server console

Once the server is running, enable the datapack once:
datapack enable "file/poplock_datapack.zip"
The datapack loads automatically on every subsequent server restart — this command only needs to be run once.

Updating the datapack

If Minecraft updates to a new version that changes the required pack format number, the datapack may stop loading and snapshot.sh will log errors when trying to call poplock:alert.
1

Re-download the datapack

sudo wget -O /usr/local/games/minecraft_server/java/world/datapacks/poplock_datapack.zip \
  https://github.com/Scyne/PopLockRP/raw/refs/heads/main/poplock_datapack.zip
2

Reload datapacks without restarting

From the server console (attach with serv console):
reload
If you see Unknown function poplock:alert in the snapshot log, the pack format number declared in pack.mcmeta inside the zip does not match your server version. To find the correct format number, run version in the server console, look up the corresponding pack format for that Minecraft release, then rebuild the datapack zip with the matching value in pack.mcmeta and re-download it.