Minecraft: Difference between revisions

From NixOS Wiki
imported>Aaronchall
new minecraft page stub
 
Sen (talk | contribs)
I made a minecraft page showing different clients, installation and troubleshooting. Note: We should make a seperate page for servers e.g minecraft:servers?
Line 1: Line 1:
== Minecraft client ==
[https://www.minecraft.net/about-minecraft Minecraft] is a sandbox game about building, surviving, fighting, and being creative, developed by Mojang Studios.<ref>[https://www.minecraft.net/en-us/about-minecraft https://www.minecraft.net/about-minecraft]</ref>


Look for prismlauncher or atlauncher in nixpkgs.


- [https://search.nixos.org/packages?channel=23.11&show=prismlauncher&from=0&size=100&sort=relevance&type=packages&query=minecraft nixpkgs.prismlauncher]
[https://www.minecraft.net/about-minecraft Minecraft] has two variants: "Minecraft: Java Edition" and "Minecraft: Bedrock Edition".
- [https://search.nixos.org/packages?channel=23.11&show=atlauncher&from=0&size=100&sort=relevance&type=packages&query=minecraft nixpkgs.atlauncher]


As of this writing the [https://search.nixos.org/packages?channel=23.11&show=minecraft&from=0&size=100&sort=relevance&type=packages&query=minecraft nixpkgs.minecraft] was not working on multiple nixos installations.
* Minecraft: Java Edition is only available on Windows, MacOS and Linux and is known for modding.
* Minecraft: Bedrock Edition is available on Windows, Xbox One, Xbox Series S and X, PlayStation 4 and 5, Nintendo Switch, Android, iOS. Bedrock is not playable on Linux due to UWP applications not being supported on Linux.<ref>https://www.minecraft.net/article/java-or-bedrock-edition</ref><ref>[https://learn.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide https://learn.microsoft.com/windows/uwp/get-started/universal-application-platform-guide]</ref>


== Minecraft Server Setup ==
== Launchers ==
'''Offical Minecraft Launcher:''' [https://www.minecraft.net/download Website] — [https://search.nixos.org/packages?show=minecraft Package/pkgs.minecraft] <!-- Disclaimer: 1.19 or higher are not working, using alternative clients is strongly recommended. -->


We need more contributors here - see also:
'''Prismlauncher:''' A free, open source launcher. [https://prismlauncher.org/ Website] — [https://search.nixos.org/packages?show=prismlauncher Package/pkgs.prismlauncher]


- https://discourse.nixos.org/t/howto-setting-up-a-nixos-minecraft-server-using-the-newest-version-of-minecraft/3445
'''ATLauncher:''' A simple and easy to use Minecraft launcher which contains many different modpacks for you to choose from and play. [https://atlauncher.com/about Website] — [https://search.nixos.org/packages?show=atlauncher Package/pkgs.atlauncher]
 
'''Badlion Client:''' A closed source PvP Modpack. [https://www.badlion.net/ Website] — [https://search.nixos.org/packages?show=badlion-client Package/pkgs.badlion-client]
 
'''Lunar Client:''' A free Minecraft client with mods, cosmetics, and performance boost. [https://www.lunarclient.com/ Website] — [https://search.nixos.org/packages?show=lunar-client Package/pkgs.lunar-client]
 
'''hmcl:''' A Minecraft Launcher which is multi-functional, cross-platform and popular. [https://hmcl.huangyuhui.net/ Website] — [https://search.nixos.org/packages?show=hmcl Package/pkgs.hmcl]
 
== Installation ==
Your preferred client can be either imperatively installed by typing <code>nix-env -iA nixos.<LAUNCHER></code> or <code>nix profile install nixpkgs#<LAUNCHER></code> if [[Flakes]] are enabled. Preferably, install the package declaratively and globally by typing <syntaxhighlight lang="nix">
environment.systemPackages = [
  pkgs.<LAUNCHER>
];
</syntaxhighlight>Alternatively, the package can be installed per-user with <code>users.users.<USERNAME>.packages</code> or [[home-manager]]
 
For Nix Native, use:<syntaxhighlight lang="nix">
users.users.<USERNAME>.packages = [
  pkgs.<LAUNCHER>
];
</syntaxhighlight>For home-manager, use:<syntaxhighlight lang="nix">
home.packages = [
  pkgs.<LAUNCHER>
];
</syntaxhighlight>
 
== Troubleshooting ==
 
=== Prismlauncher doesn't have Java Version XX. ===
The Prismlauncher package can be overridden with <code>(pkgs.prismlauncher.override { jdks = [ pkgs.<JAVA_PACKAGE> ]; })</code>. For example: <code>(pkgs.prismlauncher.override { jdks = [ pkgs.temurin-bin-21 pkgs.temurin-bin-8 pkgs.temurin-bin-17 ]; })</code>
 
=== Minecraft can’t start without Java Version XX. ===
Different Minecraft versions need different [[Java]] versions
{| class="wikitable"
|+
!Minecraft Version
!Minimum Compatible JRE Version
|-
|< 1.17
|8
|-
|1.17
|16
|-
|>= 1.18
|17
|}
 
=== Official Minecraft Launcher fails to start the game. ===
It is possible that you are attempting to start a version of Minecraft that is 1.19 or higher. Unfortunately, this is broken on NixOS. It is strongly recommended to use alternative launchers.

Revision as of 18:08, 5 April 2024

Minecraft is a sandbox game about building, surviving, fighting, and being creative, developed by Mojang Studios.[1]


Minecraft has two variants: "Minecraft: Java Edition" and "Minecraft: Bedrock Edition".

  • Minecraft: Java Edition is only available on Windows, MacOS and Linux and is known for modding.
  • Minecraft: Bedrock Edition is available on Windows, Xbox One, Xbox Series S and X, PlayStation 4 and 5, Nintendo Switch, Android, iOS. Bedrock is not playable on Linux due to UWP applications not being supported on Linux.[2][3]

Launchers

Offical Minecraft Launcher: WebsitePackage/pkgs.minecraft

Prismlauncher: A free, open source launcher. WebsitePackage/pkgs.prismlauncher

ATLauncher: A simple and easy to use Minecraft launcher which contains many different modpacks for you to choose from and play. WebsitePackage/pkgs.atlauncher

Badlion Client: A closed source PvP Modpack. WebsitePackage/pkgs.badlion-client

Lunar Client: A free Minecraft client with mods, cosmetics, and performance boost. WebsitePackage/pkgs.lunar-client

hmcl: A Minecraft Launcher which is multi-functional, cross-platform and popular. WebsitePackage/pkgs.hmcl

Installation

Your preferred client can be either imperatively installed by typing nix-env -iA nixos.<LAUNCHER> or nix profile install nixpkgs#<LAUNCHER> if Flakes are enabled. Preferably, install the package declaratively and globally by typing

environment.systemPackages = [
  pkgs.<LAUNCHER>
];

Alternatively, the package can be installed per-user with users.users.<USERNAME>.packages or home-manager For Nix Native, use:

users.users.<USERNAME>.packages = [
  pkgs.<LAUNCHER>
];

For home-manager, use:

home.packages = [
  pkgs.<LAUNCHER>
];

Troubleshooting

Prismlauncher doesn't have Java Version XX.

The Prismlauncher package can be overridden with (pkgs.prismlauncher.override { jdks = [ pkgs.<JAVA_PACKAGE> ]; }). For example: (pkgs.prismlauncher.override { jdks = [ pkgs.temurin-bin-21 pkgs.temurin-bin-8 pkgs.temurin-bin-17 ]; })

Minecraft can’t start without Java Version XX.

Different Minecraft versions need different Java versions

Minecraft Version Minimum Compatible JRE Version
< 1.17 8
1.17 16
>= 1.18 17

Official Minecraft Launcher fails to start the game.

It is possible that you are attempting to start a version of Minecraft that is 1.19 or higher. Unfortunately, this is broken on NixOS. It is strongly recommended to use alternative launchers.