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 shutdown | Broadcast message |
|---|---|
| 30 minutes | Server will go down for a daily snapshot in 30 minutes. |
| 15 minutes | Server will go down for a daily snapshot in 15 minutes. |
| 10 minutes | Server will go down for a daily snapshot in 10 minutes. |
| 5 minutes | Server will go down for a daily snapshot in 5 minutes. |
| 1 minute | Server will go down for a daily snapshot in 1 minute! |
| 30 seconds | Server going down for snapshot in 30 seconds! Please log off now. |
| 15 seconds | Server going down for snapshot in 15 seconds! |
| 5 seconds | Server going down for snapshot in 5 seconds! |
playsound command so that the per-player command feedback messages are suppressed in chat.
Installation
Download the datapack
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:Updating the datapack
If Minecraft updates to a new version that changes the required pack format number, the datapack may stop loading andsnapshot.sh will log errors when trying to call poplock:alert.
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.