Automatically download minecraft server jars in one line

Overview

MCDL

Automatically download minecraft server jars in one line (or one click)

Installation

  • Download (Windows, Linux)
  • Install via cargo: cargo install mcdl

Examples

  • mcdl - download latest server as server.jar
  • mcdl -s - download latest snapshot jar
  • mcdl -sp - print latest snapshot version
  • mcdl -n - download latest server as server-1.17.1.jar
  • mcdl -n 1.16.5 - download 1.16.5 as server-1.16.5.jar

Windows

To create shortcuts that will automatically download the latest snapshot:

  1. Right click on mcdl.exe and click "Create Shortcut"
  2. Right click on the newly created shortcut and click "Properties"
  3. In the "Target" text area, add "-s" to the end

You can replace the "-s" in step 3 with any of the other flags from the examples above or the usage below

Usage

USAGE:
    mcdl.exe [FLAGS] [OPTIONS] [--] [VERSION]...

FLAGS:
    -h, --help        Prints help information
    -i, --insecure    Don't check the sha1 for the file
    -l, --latest      Use latest version, snapshot or not
    -n, --named       Use the version as the file name
    -p, --print       Print the version instead of downloading it
    -q, --quiet       Don't print any unnecessary output
    -s, --snapshot    Use the latest snapshot
    -V, --version     Prints version information

OPTIONS:
    -r, --rename 
   
    ...    Provide a file name (.jar) is appended

ARGS:
    
    
     ...    Get a specific version

    
   

Why?

I thought it would be fun to write in Rust. If you wanted a single line of bash to do it, use one of these (requires jq, curl, and wget):

  • Download latest available (snapshot or release) minecraft server.jar

    curl -s $(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r ".versions[0].url") | jq -r ".downloads.server.url" | xargs wget
  • Download latest release minecraft server.jar

    curl -s $(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r ".latest.release as \$v | .versions[] | select(.id == \$v) | .url") | jq -r ".downloads.server.url" | xargs wget
  • Download latest snapshot minecraft server.jar

    curl -s $(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r ".latest.snapshot as \$v | .versions[] | select(.id == \$v) | .url") | jq -r ".downloads.server.url" | xargs wget

Example Scripts

(Windows) Automatically install latest snapshot, then start minecraft server

@echo OFF
@REM if a version file exists, check if it's the latest, otherwise download the server
if exist version.txt (
  goto checkVersion
) else (
  goto download
)

:checkVersion
@REM compare latest version with the one that is installed
mcdl.exe -sp > temp.version.txt
fc /b temp.version.txt version.txt > nul
if errorlevel 1 (
  @REM on different version - install the game
  mcdl.exe -s
  move /y temp.version.txt version.txt > nul
) else (
  @REM on same version delete the temp file
  del temp.version.txt > nul
)
goto server

@REM download the game and update the version
:download
mcdl.exe -s
mcdl.exe -sp > version.txt

@REM start the server
:server
java -Xmx4G -Xms2G -jar server.jar nogui

timeout /t 5
goto server
pause
You might also like...
Notifiy when one of Elon Musk's jets flyover your own ADS-B receiver

With inpsiration from twitter/@ElonJet, this app will print notifications when one of Elon Musk's jets fly over your own ADS-B receiver ground station.

sblade or switchblade it's a multitool in one capable of doing simple analysis with any type of data, attempting to speed up ethical hacking activities

sblade or switchblade it's a multitool in one capable of doing simple analysis with any type of data, attempting to speed up ethical hacking activities

A simple library with just one struct which is used to wrap around pointers

A simple library with just one struct which is used to wrap around pointers. This can be used to create pointers and share them across threads without the hassle of synchronization if you really do not care about that.

Building a better screen reader for the Linux desktop, one step at a time.

Building a better screen reader for the Linux desktop, one step at a time.

CFD is a tool that allows you to check one or more domains to see if they are protected by CloudFlare or not.
CFD is a tool that allows you to check one or more domains to see if they are protected by CloudFlare or not.

CFD is a tool that allows you to check one or more domains to see if they are protected by CloudFlare or not. The check is carried out based on five criteria: 3 headers in the HTTP response, IP, and SSL certificate issuer. The check result can be displayed on the screen or saved to a file.

Thin wrapper around starship.rs to format kakoune status line

kakship is just a thin wrapper around starship to format the status line of kakoune and is meant to be used with the included kakoune script kakship.kak.

cqlsh-rs is a command-line interface for interacting with Cassandra using CQL

cqlsh-rs is a command-line interface for interacting with Cassandra using CQL (the Cassandra Query Language). Originally shipped with every Cassandra package and implemented in Python 2, this tool is reimplemented in Rust.

A little command-line script written in Rust to interface with Discord webhooks.

Rust Discord Webhook Agent This is a little "script" I wrote for practice with Rust and asynchronous operations within Rust. Getting started Clone thi

The SATySFi Language Server

[WIP] SATySFi Language Server This repository is work-in-progress yet. Features Kind Function Done codeAction Add the definition of an undefined comma

Releases(0.0.2)
Owner
Isaac Hirschfeld
I like writing code
Isaac Hirschfeld
Download Apple's open source code from opensource.apple.com

Apple Open Source Downloader This repository defines a Rust crate and CLI program to automate the downloading of Apple's open source code from https:/

Gregory Szorc 6 Aug 19, 2022
A powerful minecraft bedrock software written in Rust with a powerful Typescript plugin API.

Netrex A powerful minecraft bedrock software written in RustLang. Why Netrex? It's written in Rust. Unique and straight to the point. Typescript Plugi

Netrex 51 Dec 26, 2022
Autorebase automatically rebases all of your feature branches onto master.

Autorebase automatically rebases all of your feature branches onto master. If conflicts are found it will rebase to the last commit that doesn't cause conflicts. By default, branches with an upstream are excluded. You don't need to switch to any branch, the only limitation is that a branch that is checked out and not clean will not be rebased (though I may add that in future).

Tim 66 Nov 26, 2022
Adds size optimizations to any Perseus app automatically.

Perseus Size Optimization Plugin WARNING: Until Perseus #66 is fixed, this plugin can actually increase overall binary size! Once that issue is fixed

arctic_hen7 6 Aug 14, 2022
A GitHub Action to automatically build and deploy your mdbook project.

?? deploy-mdbook The deploy-mdbook action allows you to easily build and deploy your mdBook project to GitHub Pages. See action.yml for configuration

null 27 Oct 24, 2022
🛡️ Automatically protect the default branch of new repositories in a GitHub organization

The Branch Autoprotector watches a GitHub organization and automatically protects the default branch in new repositories. This service notifies the creator of the default branch of this automatic branch protection setup by filing an issue in the repository.

Branch Autoprotector 2 Jan 31, 2022
A dynamic output configuration tool that automatically detects and configures connected outputs based on a set of profiles.

shikane A dynamic output configuration tool that automatically detects and configures connected outputs based on a set of profiles. Each profile speci

Hendrik Wolff 15 May 4, 2023
One-Stop Solution for all boilerplate needs!

One Stop Solution for all boilerplate needs! Consider leaving a ⭐ if you found the project helpful. Templa-rs Templa-rs is a one-of-a-kind TUI tool wr

IEEE VIT Student Chapter 27 Aug 28, 2022
RustSBI support on SiFive FU740 board; FU740 is a five-core heterogeneous processor with four SiFive U74 cores, and one SiFive S7 core

RustSBI 在 HiFive Unmatched 主板的支持软件 这个项目的目的是在SiFive HiFive Unmatched主板上支持RustSBI。 RustSBI是一个引导程序环境;主板上电时,RustSBI将会先行启动,而后,它将会找到一个可引导的操作系统,引导启动这个操作系统。 在

RustSBI 15 Dec 1, 2022
The never type (the true one!) in stable Rust.

::never-say-never The ! type. In stable Rust. Since 1.14.0. Better than an enum Never {} definition would be, since an instance of type ! automagicall

Daniel Henry-Mantilla 17 Jan 3, 2023