Skip to content

Instantly share code, notes, and snippets.

@tanmayb123
Last active July 1, 2024 14:24
Show Gist options
  • Save tanmayb123/d55b16c493326945385e815453de411a to your computer and use it in GitHub Desktop.
Save tanmayb123/d55b16c493326945385e815453de411a to your computer and use it in GitHub Desktop.

Minecraft on Apple Silicon

In this gist, you can find the steps to run Minecraft 1.16.4 natively on Apple Silicon (AS), without needing Rosetta 2 translation of the dependencies (mainly LWJGL and related libraries).

While it's possible to use a launcher like MultiMC to have a prettier way to run the game on AS, it requires installing even more dependencies (like QT) which take time and are difficult to distribute. Therefore, I've put together a command line-based launcher tool using a couple shell & Python scripts.

To get up and running quickly, follow the steps below. Otherwise, for more detail, watch my YouTube video.

Download my package

To begin, download the Minecraft on Apple Silicon package I've already put together, containing some pre-compiled core dependencies like LWJGL and a convenient set of setup & launcher scripts. Unzip the file, and navigate to it in your terminal. Then follow the next steps.

Download Minecraft client & client libraries

cd libraries
sh download.sh
cd ..

Download Minecraft assets

python3 downloadassets.py

Run Minecraft!

Note: Replace email@address.com and password with your actual username & password for Minecraft, but keep them enclosed in single quotes. This data is only used to communicate with Mojang's authentication servers and is never stored. The file containing your authtoken is deleted after the game launches.

sh launch.sh 'email@address.com' 'password'

@Pyrotex7
Copy link

Pyrotex7 commented Oct 5, 2021

Sort of.
I’m currently working on a python script to do that, but automating it is pretty complicated so it’s taking a while.

@cheezeeerd
Copy link

My experience with running Vanilla Minecraft 1.17 on M1 MacBook Air in 4k with 60+ fps on Fancy graphics:

I started with launching 1.16.5 using this guide, but I wanted to play Caves and Cliffs so I found a guide by @vhd... which wasn't working for me at all for some reason.
Lost and broke, I found a guide by @Pyrotex7 from Jun 8 that was completely doable with one nuance: there is currently no option to download Zulu Java 16 JDK and only v.17 is available. I tried this version but it wasn't working at first. The fix is to rename "zulu-17.jdk" folder to "zulu-16.jdk" in your MCAppleSilicon folder.

I created an account here just to write this comment; hope someone going to find it useful!

@doctorisyes
Copy link

I've managed to run it with the official launcher. You just need to patch required version json file (eg. versions/1.16.5/1.16.5.json)

  • make a copy of required version with different name (eg. versions/1.16.5/1.16.5.json => versions/1.16.5-arm/1.16.5-arm.json)
  • in json file: change "id" property to match your version name (eg. "id": "1.16.5-arm")
  • in json file: remove all entries in "libraries" property with any of lwjgl libraries
  • in json file: patch startup arguments to match something like this
      "-cp",
      "<YOUR_PATH_TO_lwjglfat>/lwjglfat.jar:${classpath}",
      "-Dorg.lwjgl.librarypath=<YOUR_PATH_TO_lwjglnatives>/",
      "-Dfml.earlyprogresswindow=false"

Then restart launcher (this is important, since launcher reloads versions only on startup), choose new *-arm version, set path to java executable and run.

Here is my version with libraries. You can use it as an example, or just unzip content into ~/Library/Application\ Support/minecraft and skip editing part. There are two versions - 1.16.5 and the latest 1.17 snapshot.

Снимок экрана 2021-04-10 в 13 35 25 Снимок экрана 2021-04-10 в 12 51 58

I just tried this with 1.17.1 and it worked perfectly. Then i tried 1.16.4 but that wouldn't work either. I have thoroughly checked for mistakes in the json file, tried changing java to Zulu 11 instead. Does this only work with 1.16.5 and above?

@kimyongsun
Copy link

kimyongsun commented Oct 25, 2021

I forgot to mention that adding Forge versions is even easier.
Just install Forge as usual, go to versions => 1.xx.x-forge-xx.x.xx and edit json property "inheritsFrom" to match your patched vanilla version. Then change the location of the java executable in the launcher.
Снимок экрана 2021-04-10 в 15 58 19
2021-04-10_13 47 33

thx man I really appreciate your work! I successfully installed the arm version in the official launcher but I can't run forge with it, when I try to start it suddenly crashes can u maybe make another tutorial with more detailed instructions and do you also know how to install optifine with it?


@kinzokurock
Hi, It's late, but I hope it helps.

스크린샷 2021-10-25 오후 8 25 00

Like this, all you have to do is replace "inheritsFrom" and then add this below.

"javaVersion": {
"component": "java-runtime-alpha",
"majorVersion": 17
},

I tried this with Azul JDK 17 on Minecraft 1.17.1.
So If you are using JDK 16, Just replace "majorVersion" to 16.

@doctorisyes
Copy link

I forgot to mention that adding Forge versions is even easier.
Just install Forge as usual, go to versions => 1.xx.x-forge-xx.x.xx and edit json property "inheritsFrom" to match your patched vanilla version. Then change the location of the java executable in the launcher.
Снимок экрана 2021-04-10 в 15 58 19
2021-04-10_13 47 33

thx man I really appreciate your work! I successfully installed the arm version in the official launcher but I can't run forge with it, when I try to start it suddenly crashes can u maybe make another tutorial with more detailed instructions and do you also know how to install optifine with it?

@kinzokurock Hi, It's late, but I hope it helps.

스크린샷 2021-10-25 오후 8 25 00

Like this, all you have to do is replace "inheritsFrom" and then add this below.

"javaVersion": {
"component": "java-runtime-alpha",
"majorVersion": 17
},

I tried this with Azul JDK 17 on Minecraft 1.17.1. So If you are using JDK 16, Just replace "majorVersion" to 16.

Thank you so much this worked. But there is one thing, how would I go about doing a JSON Document it seems to be a very different layout

@kimyongsun
Copy link

I forgot to mention that adding Forge versions is even easier.
Just install Forge as usual, go to versions => 1.xx.x-forge-xx.x.xx and edit json property "inheritsFrom" to match your patched vanilla version. Then change the location of the java executable in the launcher.
Снимок экрана 2021-04-10 в 15 58 19
2021-04-10_13 47 33

thx man I really appreciate your work! I successfully installed the arm version in the official launcher but I can't run forge with it, when I try to start it suddenly crashes can u maybe make another tutorial with more detailed instructions and do you also know how to install optifine with it?

@kinzokurock Hi, It's late, but I hope it helps.
스크린샷 2021-10-25 오후 8 25 00
Like this, all you have to do is replace "inheritsFrom" and then add this below.

"javaVersion": {
"component": "java-runtime-alpha",
"majorVersion": 17
},

I tried this with Azul JDK 17 on Minecraft 1.17.1. So If you are using JDK 16, Just replace "majorVersion" to 16.

Thank you so much this worked. But there is one thing, how would I go about doing a JSON Document it seems to be a very different layout


@doctorisyes

You can use https://jsonformatter.org . Copy the texts from JSON Document and paste it to the left side on the page. Then hit "Format/Beautify". So you can get the texts on the right side that is sorted.
Replace the original JSON Document to the new one then. Now you can get the layouts settled in shape.

@sanchezl
Copy link

sanchezl commented Oct 29, 2021

I've managed to run it with the official launcher.

Thank you @vhd! This was the simplest way to do this (for me) so far.

Notes for others following @vhd's instructions:

  1. The "versions" files are located at ~/Library/Application Support/minecraft/versions.
  2. Make sure to rename: the copied version folder and the json, and jar files in the copied folder to match the id you provided in the json file.
  3. Make sure the JDK/JRE you are using matches the javaVersion.majorVersion in your version.json file.
  4. If you install Optifine, you can similarly copy the Optifine version created by the installer (e.g. 1.17.1-OptiFine_HD_U_G9). Don't forget to give it a unique id and update the inheritsFrom value to match the customized arm version you created.

@MartinTintin3
Copy link

MartinTintin3 commented Oct 31, 2021

Hey, is it possible for you to also compile LWJGL 2, so that I can use the lwjglfat.jar and the files in lwjglnatives for instances that use lwjgl 2 instead of 3? Or at least, can you tell me how you did it?

@Mscichuj
Copy link

Mscichuj commented Nov 5, 2021

I did everything as said but when I try to launch Minecraft, it tries to start for a sec and then Minecraft luncher pops up this error:
The game crashed whilst unexpected error
Error: java.lang.NoClassDefFoundError: Could not initialize class ca.weblite.objc.RuntimeUtils
please, help me.

@doctorisyes
Copy link

The Version JSON files are different on versions like 1.12. How would I go about editing those JSON files to do the same thing we have done with newer versions on the vanilla launcher

@sanchezl
Copy link

sanchezl commented Nov 7, 2021

@Mscichuj I've seen this happen if you enable fullscreen. If that applies to you, edit you ~/Library/Application Support/minecraft/options.txt and set fullscreen:false.

@ivxvm
Copy link

ivxvm commented Nov 12, 2021

This worked pretty well for me except there is one very annoying issue: when you open any inventory, cursor is stuck at the center of the screen for ~1 second before you can move it. This is an issue in lwjgl3 itself and it was fixed somewhere in 3.3.x. So I made a nightly 3.3 build of lwjglfat and natives and it works perfect now.

Sharing in case anyone wants it as well:
https://www.mediafire.com/file/obfwvvc5uacwy91/m1_lwjgl_330_nightly.zip/file

Minor changes in code I made to make this work described here: LWJGL/lwjgl3#695

Submodule jars packed into single "fat jar" using JarSplice 0.40

@mmshivesh
Copy link

mmshivesh commented Nov 20, 2021

I’ll try to do a FabricMC version soon for 1.17, I’ll probably skip the 1.16.5 one since it’s already outdated. I’ve found Optifine only works through Fabric, and also Fabric can allow most other mods so it’s really useful with a custom launcher like this.
@Pyrotex7

Do you have a script for getting Fabric working with 1.17? I am trying to figure out if there's a way to merge this and the other fork by OP with microsoft account support and get a fully command line launcher with mods working

@Pyrotex7
Copy link

Pyrotex7 commented Nov 30, 2021

I’m sorry I haven’t responded until now, I do not have a script, but I did post some assets to using fabric with this launcher above.

EDIT: Also, it’s only for 1.17.1, not 1.17 if you were specifically referencing that.

@MatthewB188
Copy link

If anyone is confused on how to get it setup, the best and easiest way I've found is to get Lunar Client. They have an apple silicon native version, 1.8-1.18 and optifine already installed up to 1.17.1 rn. Its not the answer for everyone but its worked great for me.

@estyseesghosts
Copy link

Gonna say Lunar is easy but you lose a lot, you don’t get to use mods and Lunar’s privacy policies are kinda sketchy IMHO

If you want an easier way to run MC on Apple Silicon while still having the flexibility of playing vanilla or using your own mods with Forge or Fabric, check out my gist, especially because MultiMC now has working Microsoft authentication 😉

@vargal380
Copy link

Is there anything to do when the log says this?
image

@Pyrotex7
Copy link

Just make sure you are using the Java 17 JDK - Azul has an ARM version of it.

@sergtimosh
Copy link

sergtimosh commented Dec 18, 2021

Traceback (most recent call last): File "/Users/arsentymoshenko/Downloads/MCAppleSilicon/getuuid.py", line 22, in <module> print(resp["selectedProfile"]["id"]) KeyError: 'selectedProfile' Traceback (most recent call last): File "/Users/arsentymoshenko/Downloads/MCAppleSilicon/getusername.py", line 22, in <module> print(resp["selectedProfile"]["name"]) KeyError: 'selectedProfile' Traceback (most recent call last): File "/Users/arsentymoshenko/Downloads/MCAppleSilicon/getauthtoken.py", line 22, in <module> print(resp["accessToken"]) KeyError: 'accessToken'

I'm unable to perform login with launch.sh. The reason is, that I'm using Microsoft authentication instead of mojang.
@tanmayb123 Can you suggest how to modify script to be able to login to the Minecraft?

From what I can see it's now more complicated that direct login with mojang account
https://wiki.vg/Microsoft_Authentication_Scheme

@MartinTintin3
Copy link

MartinTintin3 commented Dec 22, 2021

guys, I FIGURED OUT HOW TO RUN THIS NATIVELY ON ANY VERSION WITHOUT DOWNLOADING ANY NATIVES!!!! YOU ONLY NEED THE ARM64 JDK! Just use this client: https://github.com/MinecraftMachina/ManyMC it will automatically have support for arm64 lwjgl and stuff if you select the arm64 jdk. EPIC. This even works for versions of the game that use lwjgl 2 not 3

@raphtlw
Copy link

raphtlw commented Jan 29, 2022

I've created a new command line application that installs Minecraft natively for Apple Silicon into the Official Minecraft launcher. I'm certain that bugs have yet to be fixed, but it has been tested by some and found to be working as intended. You can check out the repository here, and the blog post that details installation steps here.

@artemisSystem
Copy link

Since the release of 1.19 and the vanilla launcher update that came with it, minecraft can now be played natively without any extra setup. Just launch minecraft with the bundled java executable (the default setting). It also works to supply it with a custom native jdk17. If you need to try something running in rosetta, supplying an x86-64 jdk17 will work for that as well.

@estyseesghosts
Copy link

estyseesghosts commented Jun 8, 2022 via email

@artemisSystem
Copy link

my guess is that it only runs native for versions that have lwjgl 3.3.0, which i think were updated to in one of the 1.19 snapshots. 1.18 and older probably still need rosetta if you don’t do any setup, though i haven’t tested it

@MidCoard
Copy link

MidCoard commented Nov 4, 2022

I have create a tool to generate natives for miencraft version lower than 1.19(including 1.13.2 1.16.5...), which is tested on Macos M1. There is also a plan for windows arm64 and linux arm64. Hope someone could help out.

@Pyrotex7
Copy link

Pyrotex7 commented Nov 5, 2022

Neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment