Minecraft Server: Difference between revisions

updated flags and some other reordering/rewriting
Voklen (talk | contribs)
m Add syntax highlighting to code examples
 
(7 intermediate revisions by one other user not shown)
Line 37: Line 37:
     allow-cheats = true;
     allow-cheats = true;
   };
   };
   jvmOpts = "-Xms2048M -Xmx2048M";
   jvmOpts = "-Xms2048M -Xmx2048M";  
};
};
</nowiki>}}
</nowiki>}}
You might want to view the [https://minecraft.wiki/w/Server.properties#Keys list of all available server properties for the vanilla server].
You might want to view the [https://minecraft.wiki/w/Server.properties#Keys list of all available server properties for the vanilla server].


See [[#jvm-flags|See also]] for recommended flags for the <code>jvmOpts</code> option.
See [[#See also]] for recommended JVM flags for the <code>jvmOpts</code> option. These primarily depend on your [[Java]] version.
== Tips and tricks ==
== Tips and tricks ==


Line 81: Line 81:
For example:
For example:


<code>services.minecraft-server.package = pkgs.minecraftServers.vanilla-1-12;</code>
<syntaxhighlight lang="nix">
services.minecraft-server.package = pkgs.minecraftServers.vanilla-1-12;
</syntaxhighlight>


or
or


<code>services.minecraft-server.package = pkgs.papermc;</code>
<syntaxhighlight lang="nix">
services.minecraft-server.package = pkgs.papermc;
</syntaxhighlight>


=== Prefer IPv4 ===
=== Prefer IPv4 ===
Line 94: Line 98:


* [https://github.com/Infinidoge/nix-minecraft nix-minecraft], a [[flake]] based attempt to better support Minecraft related content for the Nix ecosystem. It can be used for more complex server setups, including mods and plugins.
* [https://github.com/Infinidoge/nix-minecraft nix-minecraft], a [[flake]] based attempt to better support Minecraft related content for the Nix ecosystem. It can be used for more complex server setups, including mods and plugins.
<span id="jvm-flags"></span>
* https://exa.y2k.diy/garden/jvm-args for setting additional JVM flags in the <code>jvmOpts</code> option. Some server-related software—like the Velocity proxy—have their own recommended JVM flags list.
* https://exa.y2k.diy/garden/jvm-args for setting additional JVM options in the <code>jvmOpts</code> option. Some server-related software —like the Velocity proxy—have their own recommended flags list.
* https://mcuuid.net to get a player's UUID from their current username or vice versa.
* https://mcuuid.net to get a player's UUID from their current username or vice versa.
[[Category: Applications]]
[[Category: Applications]]
[[Category: Gaming]]
[[Category: Gaming]]