Skip to content

Instantly share code, notes, and snippets.

@colebob9
Last active September 1, 2017 04:59
Show Gist options
  • Save colebob9/cfab8f6c02e6a0c7f3056db870962e96 to your computer and use it in GitHub Desktop.
Save colebob9/cfab8f6c02e6a0c7f3056db870962e96 to your computer and use it in GitHub Desktop.
Helps with the installation of Minecraft Forge on a Mac using the Minecraft included Java runtime

MacInstallForge Instructions

This script will help install Minecraft Forge (for Minecraft modding) onto your Mac.

  1. Download and Play Minecraft at least once for the version of Forge you want.
  2. Download Minecraft Forge and place it in the same folder as your Minecraft app. (Download Link, make sure to grab the "Installer" for the Minecraft version you want)
  3. Right/Two Finger Click on the Raw button for the MacInstallForge.sh file below. Click "Save Link As...", and save to the same folder where your Minecraft app is located. (Make sure the format is a "shell script".)
  4. Go to the folder that you have all your files in so far, and go to the gear dropdown menu, and click "Copy "FolderName" as Pathname" (example)
  5. Open a Terminal and type cd and press Command+V. The command should look something like this:
cd /Users/cole/Documents/Programs

Press Return.

  1. Type these commands in the same Terminal with a Return keypress after each:
chmod +x MacAutoForge.sh
./MacAutoForge.sh
  1. Click "Install Client", then "OK".
  2. You're done! Enjoy your mods!
#!/bin/bash
# MacInstallForge v1
# Used to install Minecraft Forge on a Mac using the included Java runtime
# colebob9
# Steps:
# Download and run Minecraft at least once
# Download script from page
# Must be placed in same folder with Minecraft Application
# Run command: `chmod +x MacAutoForge.sh`
# Run command: `./MacAutoForge.sh`
# TODO:
# * Add checks if Forge or Minecraft exists
# * See if possible to install from command line to save time
SCRIPTDIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
# Find Java runtime
cd Minecraft.app
cd Contents/runtime/jre-x64/
JAVAVERSION="$(ls -1v | head -1)"
echo "Latest Java runtime version (from Minecraft): ${JAVAVERSION}"
cd ${JAVAVERSION}
cd bin
JAVALOCATION="$(pwd)"
# Return back to script location
cd ${SCRIPTDIR}
# Find Forge in current dir
FORGE="$(ls -t -d forge*.jar | head -1)"
echo "Found MC Forge: ${FORGE}"
LAUNCHFORGE="${JAVALOCATION}/java -jar ${FORGE}"
echo "Running command: ${LAUNCHFORGE}"
# Run forge installer
echo ""
echo "Click \"Install Client\", then \"OK\"!"
echo ""
$LAUNCHFORGE
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment