Minecraft

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources
Article status
This article has some todo items:
  • Add info about modded clients and servers (Forge, Fabric etc.)
  • Add info about other popular server cores (Paper, Sponge etc.), alternative implementations (Minestom, Glowstone etc.) etc.
  • Add optimizations and tips specifically for Gentoo users

Minecraft is a sandbox game developed by Mojang. The game was developed in Java by creator Markus "Notch" Persson and has been ported to several platforms throughout its development lifecycle. Since the public early alpha release in 2009, the game has sold over 200 million copies making it one of the best selling video games of all time.

Clients

Minecraft can be installed using any number of available launchers. While some launchers can be compiled from source, it is recommended to install the package using Portage as this ensures the correct Java builds are installed and maintained on the system.

Following list includes applications than can launch official Minecraft client implementation. However, there are also exist alternative client implementations. Find a list of these on https://wiki.vg/Client_List.

Official launcher

To install the official Minecraft launcher (games-action/minecraft-launcher), run:

root #emerge --ask games-action/minecraft-launcher

Prism Launcher

Free/libre software launcher for Minecraft with support for multiple instances, managing modpacks and mods etc.

root #emerge --ask games-action/prismlauncher

musl-based system

The official launcher is linked to glibc and is therefore unusable. Prism Launcher can be compiled and run, but it uses the LWJGL binaries provided by Mojang, which are also linked to glibc, making Minecraft non-launchable. As a solution, it is possible to install and run Prism Launcher using Flatpak:

user $flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
user $flatpak install --user flathub org.prismlauncher.PrismLauncher

To run Prism Launcher use the following command (it is important to provide the locale, otherwise Minecraft will not start):

user $flatpak run --env=LC_ALL=en_US.UTF-8 org.prismlauncher.PrismLauncher

After launching, click on the settings button and click the button named Java. Place the following code in a text box named "JVM Arguments":

CODE
-Dorg.lwjgl.glfw.libname=/app/lib/libglfw.so

After this it will be possible to play Minecraft.

Servers

Official server

To install the official Minecraft server (games-server/minecraft-server), run:

root #emerge --ask games-server/minecraft-server

Troubleshooting

Minecraft launcher errors

Errors with this package are uncommon, however the following have been noted:

In some instances when executing minecraft-launcher the following output is produced:

user $./minecraft-launcher
[0229/184549.183275:ERROR:sandbox_linux.cc(346)] InitializeSandbox() called with multiple threads in process gpu-process.

This can be resolved by issuing the following options in conjunction with minecraft-launcher:

user $MESA_GLSL_CACHE_DISABLE=true ./minecraft-launcher

Crash in org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes

Older Minecraft versions (which use java 1.8, e.g playing specific modpacks) use LWJGL 2 rather than LWJGL 3. It lacks Wayland support.

If getting a crash like:

java.lang.ExceptionInInitializerError
	at azi.ad(SourceFile:284)
	at azi.f(SourceFile:688)
	at net.minecraft.client.main.Main.main(SourceFile:152)
	at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88)
	at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126)
	at org.prismlauncher.EntryPoint.main(EntryPoint.java:71)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:951)
	at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
	at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
	... 6 more

or

RuntimeException: No OpenGL context found in the current thread.

try installing x11-apps/xrandr and/or trying an X desktop session.

See also

  • Games — a landing page for many of the games (especially open source variants) available in Gentoo's main ebuild repository.
  • Java — a programming language, originally developed by Sun Microsystems, which uses a platform-independent virtual machine to execute Java bytecode in real-time.
  • Minetest — an infinite-world block sandbox game and game engine that is heavily inspired by Minecraft and InfiniMiner.