summaryrefslogtreecommitdiff
path: root/papermc_getlatest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'papermc_getlatest.sh')
-rwxr-xr-xpapermc_getlatest.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/papermc_getlatest.sh b/papermc_getlatest.sh
new file mode 100755
index 0000000..f8d0ca9
--- /dev/null
+++ b/papermc_getlatest.sh
@@ -0,0 +1,13 @@
+PROJECT="paper"
+MINECRAFT_VERSION="1.20.4"
+
+LATEST_BUILD=$(curl -s https://api.papermc.io/v2/projects/${PROJECT}/versions/${MINECRAFT_VERSION}/builds | \
+ jq -r '.builds | map(select(.channel == "default") | .build) | .[-1]')
+
+JAR_NAME=${PROJECT}-${MINECRAFT_VERSION}-${LATEST_BUILD}.jar
+
+PAPERMC_URL="https://api.papermc.io/v2/projects/${PROJECT}/versions/${MINECRAFT_VERSION}/builds/${LATEST_BUILD}/downloads/${JAR_NAME}"
+
+# Download the latest PaperMC version
+curl -o /opt/minecraft/server.jar $PAPERMC_URL
+echo "Downloads completed"