Skip to content

Instantly share code, notes, and snippets.

@Lampadina17
Last active January 20, 2024 14:59
Show Gist options
  • Save Lampadina17/849e167c1bf60426dd030e581482d009 to your computer and use it in GitHub Desktop.
Save Lampadina17/849e167c1bf60426dd030e581482d009 to your computer and use it in GitHub Desktop.
Handy script for launching minecraft with morpheus launcher from commandline
#!/bin/bash
# Get the user's home folder
home_folder=$HOME
# Define the Updater.jar path
updater_path="$home_folder/Updater.jar"
# Check if Updater.jar already exists
if [ ! -f "$updater_path" ]; then
# Download the Updater.jar only if it doesn't exist
wget https://morpheuslauncher.it/downloads/Updater.jar -P "$home_folder"
fi
# Run the installer
java -jar "$updater_path"
# Ask the user to enter version
read -p "Enter minecraft version: " version
# Ask the user to enter the username
read -p "Enter your Username: " username
# Ask the user to enter the UUID
read -p "Enter your UUID: " uuid
# Ask the user to enter the token (default to 0 if not provided)
read -p "Enter minecraft token (Enter to use default value 0): " token
token="${token:-0}"
# Build the Java command with the entered values
java_command="java -Djava.library.path='$home_folder/.minecraft/versions/$version/natives' -jar '$home_folder/.morpheus/Launcher.jar' -v $version -u $uuid -n $username -t $token"
# Execute the Java command
echo "Executing the following Java command:"
echo "$java_command"
eval "$java_command"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment