User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

How to setup Minecraft 1.15.2 on Pi4

Tue Apr 14, 2020 8:18 pm

How to setup Full Minecraft 1.15.2 (with Optifine preview) on Raspberry Pi4

Edit: 28/06/2020 now 32bit/64bit, optifine pre30

Please note :
Do this at your own risk.
If you have any doubts use a spare SD card.
I'm using the official 5.1V 3.0A power supply, with the Pi4 in an open sided case with small fan (currently off).
Should work on 2GB,4GB and 8GB Pi4.
I do not advise trying to run this over VNC.
Please make sure you are using your own valid Minecraft account.

This tutorial was tested using Rasbperry Pi OS 32bit and 64bit(beta)

1 Download and run setup script
This will take a few minutes, including installing Oracle java.

Code: Select all

mkdir ~/Minecraft && cd ~/Minecraft && wget https://www.dropbox.com/s/8euqkjtxd6xo6v0/setupMC1_15_2_3264.sh && chmod +x setupMC1_15_2_3264.sh && ./setupMC1_15_2_3264.sh
2 Run Minecraft launcher :

Code: Select all

./runLauncher.sh
Login with Minecraft email and password
Click 'edit profile' and select use release - 'release 1.15.2', then 'save profile'
Click Play to install game
You will then receive an error ([... ERROR]: Game ended with bad state (exit code 1))
Close launcher, may need to press Ctrl-C to return to command prompt

3 Install Optifine

Code: Select all

./optifineInstall.sh
Click install.

4 Run Minecraft launcher

Code: Select all

./runLauncher.sh
Select the OptiFine profile and click play. The launcher will crash, may need to press Ctrl-C to return to command prompt.

5 Edit runMC1_15_2_OptifineG1pre.sh

Code: Select all

mousepad runMC1_15_2_OptifineG1pre.sh
Update MINECRAFT_LOGIN, MINECRAFT_USERNAME and MINECRAFT_PASSWORD to your own (may need "" for special characters)

6 Start Minecraft from terminal window

Code: Select all

cd ~/Minecraft
./runMC1_15_2_OptifineG1pre.sh
Change options in Minecraft to reduce render chunks to 3.

Hopefully Minecraft should run :P
Last edited by rpiMike on Sun Jun 28, 2020 4:18 pm, edited 3 times in total.

dieserniko
Posts: 8
Joined: Mon Apr 13, 2020 11:01 am

Re: How to setup Minecraft 1.15.2 on Pi4

Tue Apr 14, 2020 10:13 pm

I've got a question about the installation part. Does it have to be installed by the launcher because else it would be illegal? If so, i have to take my post down.

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Tue Apr 14, 2020 10:16 pm

dieserniko wrote:
Tue Apr 14, 2020 10:13 pm
I've got a question about the installation part. Does it have to be installed by the launcher because else it would be illegal? If so, i have to take my post down.
Yes, I believe it should be. If you are allowing people to use Minecraft without buying a license that would be illegal.

Lada46
Posts: 4
Joined: Wed Apr 15, 2020 3:50 pm

Re: How to setup Minecraft 1.15.2 on Pi4

Wed Apr 15, 2020 4:21 pm

not working...
after run ./runMC1_15_2_OptifineG1.sh
Error: Could not find or load main class net.minecraft.launchwrapper.Launch

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Wed Apr 15, 2020 5:22 pm

Did you get any errors about 'java command not found' during the install?

I've just added the full paths to java in the tutorial.

I've just re-installed on a fresh sd card, worked ok with paths added. Did you change anything else in the run script when you edited your details?

Lada46
Posts: 4
Joined: Wed Apr 15, 2020 3:50 pm

Re: How to setup Minecraft 1.15.2 on Pi4

Wed Apr 15, 2020 9:44 pm

i edit only this MINECRAFT_LOGIN, MINECRAFT_USERNAME and MINECRAFT_PASSWORD in run script
only this version 1.12.2 works for me, others don't work... 1.14.4 or 1.15.2 dont work
is there any way to turn on the game? without launcher? or without OptiFine?
only this versio 1.12.2 works for me and all servers work on version 1.15... I want to turn on version 1.15 to play on other servers,
but I don't know what's wrong

I need help....

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Thu Apr 16, 2020 6:07 am

Which Pi are you using? Are you on the latest Raspbian Buster? Did you see any errors during the install?

Lada46
Posts: 4
Joined: Wed Apr 15, 2020 3:50 pm

Re: How to setup Minecraft 1.15.2 on Pi4

Thu Apr 16, 2020 8:54 am

i have raspberry pi 4 4gb and i use raspbian and everything i have updated

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Thu Apr 16, 2020 9:10 am

Did you see any errors during the install?

Lada46
Posts: 4
Joined: Wed Apr 15, 2020 3:50 pm

Re: How to setup Minecraft 1.15.2 on Pi4

Thu Apr 16, 2020 10:54 pm

I had no error during installation ..

UlkNudel
Posts: 1
Joined: Sat Apr 18, 2020 11:11 pm

Re: How to setup Minecraft 1.15.2 on Pi4

Sat Apr 18, 2020 11:29 pm

Lada46 wrote:
Wed Apr 15, 2020 4:21 pm
not working...
after run ./runMC1_15_2_OptifineG1.sh
Error: Could not find or load main class net.minecraft.launchwrapper.Launch
If you weren't able to solve it by now
Was Optifine actually properly installed and you ran the Optifine Profile and not just the 1.15.2 profile? That was my problem and I had to run the optifine jar seperately again.

Enderboy
Posts: 2
Joined: Sun Apr 19, 2020 1:49 pm

Re: How to setup Minecraft 1.15.2 on Pi4

Sun Apr 19, 2020 11:10 pm

Thanks for the tutorial. I do not know what I'm doing wrong. I have recorded the screen in case someone sees the error. Thank you.

https://www.youtube.com/watch?v=SM3w2JI ... e=youtu.be

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Mon Apr 20, 2020 2:07 pm

Looks like the install worked, can't see the actual error at the end?

I assume your on a Pi4 with Raspbian Buster?

Hope that wasn't your password in the video!

Enderboy
Posts: 2
Joined: Sun Apr 19, 2020 1:49 pm

Re: How to setup Minecraft 1.15.2 on Pi4

Mon Apr 20, 2020 6:59 pm

rpiMike wrote:
Mon Apr 20, 2020 2:07 pm
Looks like the install worked, can't see the actual error at the end?
https://pastebin.com/Y62KCRXF
rpiMike wrote:
Mon Apr 20, 2020 2:07 pm
I assume your on a Pi4 with Raspbian Buster?
Yes, Raspberry Pi 4 4gb.

Yes, Raspberry Pi imager v1.2, "CHOOSE OS" button, Raspbian Released 2020-02-13.

rpiMike wrote:
Mon Apr 20, 2020 2:07 pm
Hope that wasn't your password in the video!
I have stopped recording to write the password.



Thank you

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Mon Apr 20, 2020 7:08 pm

Have you updated Raspbian Buster?

Code: Select all

sudo apt update
sudo apt full-upgrade -y

dsynnott
Posts: 13
Joined: Fri Apr 24, 2020 1:43 am

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 1:50 am

Thank you, rpiMike, for the work you've done! My daughter has been pestering me about this for a while....

I have a problem when running. Installed great, no issues. When I connect to server, it wants to install a resource pack. the resource pack install gets most of the way through. Then it crashes. Following is displayed in terminal

window[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/20_glass/glass.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/20_glass/glass_pane.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/30_bookshelf/bookshelf.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/40_sandstone/sandstone.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/41_red_sandstone/red_sandstone.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] Multipass connected textures: false
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] BetterGrass: Parsing default configuration optifine/bettergrass.properties
[18:39:47] [Server-Worker-10/INFO]: [OptiFine] Mipmap levels: 4
[18:39:47] [Server-Worker-12/INFO]: [OptiFine] Multitexture: false
[18:39:51] [Server-Worker-9/ERROR]: Using missing texture, unable to load minecraft:textures/block/water_flow.png
java.io.IOException: Could not load image: Out of memory
at cxr.a(NativeImage.java:149) ~[cxr.class:?]
at cxr.a(NativeImage.java:110) ~[cxr.class:?]
at cxr.a(NativeImage.java:98) ~[cxr.class:?]
at eai.a(AtlasTexture.java:477) ~[eai.class:?]
at eai.lambda$null$3(AtlasTexture.java:457) ~[eai.class:?]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) [?:1.8.0_241]
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) [?:1.8.0_241]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_241]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_241]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_241]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_241]
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 563736 bytes for Chunk::new
# An error report file with more information is saved as:
# /home/pi/Minecraft/hs_err_pid3329.log
#
# Compiler replay data is saved as:
# /home/pi/Minecraft/replay_pid3329.log
AL lib: (EE) alc_cleanup: 1 device not closed

Any ideas on how to fix?

dsynnott
Posts: 13
Joined: Fri Apr 24, 2020 1:43 am

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 3:44 am

I'm getting a lot of memory related errors....

20:40:54] [main/INFO]: [CHAT]
[20:40:54] [main/INFO]: [CHAT] For basic help type /Help
[20:40:54] [main/INFO]: [CHAT] Store > store.mcaim.com
[20:40:54] [main/INFO]: [CHAT] Discord > https://discord.gg/KRHGWWY
mmap of bo 301 (offset 0x0000000018770000, size 774144) failed
Aborted

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 2:09 pm

dsynnott wrote:
Fri Apr 24, 2020 1:50 am
Thank you, rpiMike, for the work you've done! My daughter has been pestering me about this for a while....

I have a problem when running. Installed great, no issues. When I connect to server, it wants to install a resource pack. the resource pack install gets most of the way through. Then it crashes. Following is displayed in terminal

window[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/20_glass/glass.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/20_glass/glass_pane.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/30_bookshelf/bookshelf.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/40_sandstone/sandstone.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] ConnectedTextures: optifine/ctm/default/41_red_sandstone/red_sandstone.properties
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] Multipass connected textures: false
[18:39:43] [Server-Worker-10/INFO]: [OptiFine] BetterGrass: Parsing default configuration optifine/bettergrass.properties
[18:39:47] [Server-Worker-10/INFO]: [OptiFine] Mipmap levels: 4
[18:39:47] [Server-Worker-12/INFO]: [OptiFine] Multitexture: false
[18:39:51] [Server-Worker-9/ERROR]: Using missing texture, unable to load minecraft:textures/block/water_flow.png
java.io.IOException: Could not load image: Out of memory
at cxr.a(NativeImage.java:149) ~[cxr.class:?]
at cxr.a(NativeImage.java:110) ~[cxr.class:?]
at cxr.a(NativeImage.java:98) ~[cxr.class:?]
at eai.a(AtlasTexture.java:477) ~[eai.class:?]
at eai.lambda$null$3(AtlasTexture.java:457) ~[eai.class:?]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) [?:1.8.0_241]
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) [?:1.8.0_241]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_241]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_241]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_241]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_241]
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 563736 bytes for Chunk::new
# An error report file with more information is saved as:
# /home/pi/Minecraft/hs_err_pid3329.log
#
# Compiler replay data is saved as:
# /home/pi/Minecraft/replay_pid3329.log
AL lib: (EE) alc_cleanup: 1 device not closed

Any ideas on how to fix?
Which model of Pi? Do you have to download the resource pack? Looks like it ran out if memory.

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 2:11 pm

dsynnott wrote:
Fri Apr 24, 2020 3:44 am
I'm getting a lot of memory related errors....

20:40:54] [main/INFO]: [CHAT]
[20:40:54] [main/INFO]: [CHAT] For basic help type /Help
[20:40:54] [main/INFO]: [CHAT] Store > store.mcaim.com
[20:40:54] [main/INFO]: [CHAT] Discord > https://discord.gg/KRHGWWY
mmap of bo 301 (offset 0x0000000018770000, size 774144) failed
Aborted
Is that a Minecraft error?

dsynnott
Posts: 13
Joined: Fri Apr 24, 2020 1:43 am

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 5:30 pm

I've got a Raspberry Pi 4, 4GB memory, I've updated to the latest Raspian OS patches.

When I configured the initial connection for multi-user server, the server required the resource pack be loaded. When I declined to download it, (it did not download), the server disconnected the session and Minecraft responded by crashing. When I accepted the download, I received the errors listed in the post.

Both previous posts are errors from Minecraft. I'm seeing mmap errors on other servers. I'm even seeing mmap errors when running as single user locally. In both cases, the game runs approximately 90 seconds and then crashes. It seems that Minecraft has insufficient memory to run.

It appears that Minecraft is indeed running out of memory. It would be hard to believe that 4GB RAM is insufficient when, in other posts, it appears that Pi4 with 2GB RAM could run this. I'm wondering if the launcher is configured, (on command line?), to limit obtaining additional memory? Or max memory size is too small?

What do you think?

dsynnott
Posts: 13
Joined: Fri Apr 24, 2020 1:43 am

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 6:01 pm

My theory was wrong. It is the reverse. I ran top to see how memory was being used.

Prior to starting Minecraft, top listed Buff/Cache approximately equal to 1300 MiB. approximetely 2000 MiB free.

When Minecraft running, Buff/Cache remained consistent,

Free dropped to approximately 500 MiB. This dropped quickly as the game proceeded, Just prior to crash Free memory was 145 MiB. Presumably Minecraft requested additional memory and crashed.

Looks like it did indeed run out of memory.

dsynnott
Posts: 13
Joined: Fri Apr 24, 2020 1:43 am

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 9:29 pm

I ran additional tests.

Tests:
1. Reboot. I was concerned about how much memory buff/cache consumed. closing out programs did not reduce buff/cache consumption much. I rebooted Pi 4 and buff/cache was reasonable, 356 MiB. Looks like Raspian OS had something it thought it needed to write to disk.....

Free memory was much better, 3000 MiB. When I started Minecraft, Freemem remained at 1600 MiB or higher, with used memory hanging around 1700 MiB. This seemed promising.

2. Multiplayer. Joined a server that wanted me to download a resource pack. (play.chasecraft.gg) Same error produced on terminal and Minecraft crashed. Error was:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 563736 bytes for Chunk::new

3. Single player. Restarted Minecraft and attempted single player mode. Ran for about 90 seconds and crashed again. This time, the mmap error was replaced by:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 563736 bytes for Chunk::new

Under both tests, Free Memory remained above 1600 MiB.

It appears that java/minecraft is unable to grab more memory, even though memory is available. Are we limiting maximum memory on the command line? If so, can we raise it?

User avatar
rpiMike
Posts: 2323
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 9:45 pm

I believe the only way to allocate more memory would be to use a 64 bit os such as sakaki's Gentoo 64 bit.

dsynnott
Posts: 13
Joined: Fri Apr 24, 2020 1:43 am

Re: How to setup Minecraft 1.15.2 on Pi4

Fri Apr 24, 2020 10:55 pm

Would I have the same issue with 1.14 or earlier versions of Minecraft?

dsynnott
Posts: 13
Joined: Fri Apr 24, 2020 1:43 am

Re: How to setup Minecraft 1.15.2 on Pi4

Sat Apr 25, 2020 2:02 am

I reinstalled and also increased the video split memory to 256 and configured the GL-Driver.

It works a bit better, running 5 or 10 minutes before it crashed.

Are there other things that I might need to configure, but missed?

Does your script install everyting in the /home/pi/Mincraft and the /home/pi/.minecraft directories?

Return to “Gaming”