Arch linux minecraft server

Arch Linux User Repository

Search Criteria

Package Details: minecraft-server 1.17.1-2

Package Actions

Git Clone URL: https://aur.archlinux.org/minecraft-server.git (read-only, click to copy)
Package Base: minecraft-server
Description: Minecraft server unit files, script, and jar
Upstream URL: https://minecraft.net/
Keywords: bash minecraft official script server
Licenses: custom
Conflicts: minecraft-canary, minecraft-server-systemd
Submitter: sorcix
Maintainer: edh
Last Packager: edh
Votes: 148
Popularity: 1.08
First Submitted: 2010-11-29 15:52
Last Updated: 2021-07-13 12:38

Dependencies (8)

  • awk (gawk-git, gawk)
  • bash (bash-devel-git, bash-devel-static-git, bash-xdg-dirs-git, bash-git)
  • sed (sed-git)
  • sudo (nosudo, opendoas-sudo, fake-sudo, sudo-git, sudo-hg, sudo-selinux)
  • tmux (tmux-tcl-git, tmux-fullwidth-backspace, tmux-ver-28, tmux-git, tmux-xdg-git, sixel-tmux-git)
  • java-runtime-headless>=16 (jdk5, jre7-openjdk-headless-infinality, java-8-openjdk-shenandoah, jre8-openjdk-headless-infinality, jdk9, jre9, jdk-devel, jre10, jdk6, jdk12-openj9-bin, zulu-12-bin, jre6, jre12, jdk8-openjdk-dcevm, server-jre, jdk13-openj9-bin, jdk9-openj9-bin, jdk10, jdk11-openjdk-dcevm, jre8-openjdk-jetbrains-headless, jdk10-openj9-bin, jdk14-openj9-bin, jdk7, jre7, jre14, jdk8-jetbrains, zulu-14-bin, zulu-13-bin, jdk-bcl, jre-bcl, amazon-corretto-15, jdk11-openjdk-dcevm-conflicts-fixed, zulu-embedded-jdk8, sapmachine-jdk-bin, jdk15-adoptopenjdk, jdk11-msopenjdk-bin, liberica-jre-8-full-bin, jdk8-arm, jre11-jetbrains-headless-imfix, zulu-11-bin, zulu-8-bin, zulu-15-bin, amazon-corretto-16, jdk-openj9-bin, jdk11-adoptopenjdk, liberica-jdk-8-full-bin, liberica-jdk-11-bin, liberica-jdk-11-full-bin, liberica-jdk-11-lite-bin, liberica-jre-11-bin, liberica-jre-11-full-bin, zulu-embedded-jdk11, jre8-adoptopenjdk-headless, jre-openj9-headless, jre8, jdk8, jre11, jre8-openjdk-shenandoah-headless, zulu-16-bin, jdk-arm, jdk7-j9-bin, jdk7r1-j9-bin, jdk11-openj9-bin, jdk8-openj9-bin, jdk8-j9-bin, jdk11-j9-bin, java-openjdk-bin, amazon-corretto-17, jre, zulu-17-bin, jdk-jetbrains, liberica-jdk-full-bin, amazon-corretto-8, amazon-corretto-11, jdk-adoptopenjdk, jdk16-adoptopenjdk, java-openjdk-loom-ea-bin, jre-jetbrains, zulu-jre-fx-bin, java-openjdk-ea-bin, jre-openjdk-headless, jre11-openjdk-headless, jre7-openjdk-headless, jre8-openjdk-headless)
  • netcat (nmap-netcat, libressl-netcat, gnu-netcat, openbsd-netcat) (optional) – required in order to suspend an idle server
  • tar (tar-libarchive, tar-git, tar-parallel) (optional) – needed in order to create world backups

Required by (0)

Sources (8)

Pinned Comments

edh commented on 2016-06-18 18:24

To get an overview of the available options provided by the management script, be sure to have a look at the help page or read the according section on the ArchWiki article [1].

You can quit the console without shutting down the server by press ctrl+a d (first ctrl+a and after releasing the buttons press d; ctrl+b also works). This will detach your input from the server console. The attaching and detaching is done with tmux (previously GNU screen) since it lets you view and type into the console, send single commands to it and keep it alive without a connected user. Take a look at the the command overview at the ArchWiki [2] to get a feel for its power. (@carmelo12341)

Latest Comments

edh commented on 2021-10-03 18:38

The list displayed in the AUR seems to not take version requirements into account. pacman will of course check for version requirements upon installation though.

InFerNo commented on 2021-10-03 18:33

Hi, @edh, yes starting the server manually led me to the error, but that issue is resolved.

I think I am misunderstanding the dependencies on this package because java-runtime-headless>=16 has a list of possible packages to satisfy the dependency. However jre8-openjdk-headless is listed but does not work with the latest version of Minecraft (which is what I was using). I don’t know how the large list with possible dependency candidates above is composed, perhaps this is out of your control.

edh commented on 2021-10-03 16:40

Yes, sorry, the log file would not have been conclusive. However, starting the server by hand would have told you as much. Or in other words, I don’t think one can call this an error in the package.

Btw. the java dependency has long been java-runtime-headless>=16 .

InFerNo commented on 2021-10-03 12:21

@edh, the logfile gets written by Minecraft, but if Minecraft can’t start then it doesn’t write anything to the logfile(s). It was the first thing I checked.

The package dependencies need to be updated, because versions lower than 16 will no longer work. At the very least they should be checked.

edh commented on 2021-10-02 08:23

The log file of your server could have probably told you so from the beginning.

Both ctrl+a and ctrl+b work so not much should have changed for the user. I updated the comment though to point to tmux and not screen.

InFerNo commented on 2021-10-01 12:23

edit: I fixed it by installing the latest openjdk ( jre-openjdk-headless ) version and setting it as the default: sudo archlinux-java set java-16-openjdk

Читайте также:  Genopro для mac os

The version that no longer works is jre8-openjdk-headless .

@edh, unfortunately running these commands made no change. The output was:

The same for idle_server_minecraft . BTW you should update the pinned comment too.

edit: I believe the issue is related to Java:

Exception in thread «main» java.lang.UnsupportedClassVersionError: net/minecraft/server/Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Version 60 = Java 16

edh commented on 2021-10-01 09:02

Very good point! I forgot to include the install file in the PKGBUILD 🙁

The message should have been:

InFerNo commented on 2021-09-30 18:42

edit: here is my output, I see no instructions:

edh commented on 2021-09-29 14:14

@InFerNo The management script switched from GNU screen to tmux in the meantime. Did you follow the instructions that were printed after the upgrade?

InFerNo commented on 2021-09-29 13:19

I keep getting minecraftd[133901]: The corresponding tmux session for minecraft was already dead. How can I fix this? I upgraded from 1.16.5.

Copyright © 2004-2021 aurweb Development Team.

AUR packages are user produced content. Any use of the provided files is at your own risk.

Источник

Minecraft

Minecraft is a game about breaking and placing blocks. At first, people built structures to protect against nocturnal monsters, but as the game grew players worked together to create wonderful, imaginative things.

Contents

Client

Installation

The minecraft client can be installed via the minecraft-launcher AUR package. It provides the official game launcher, a script to launch it and a .desktop file. The package is officially recommended by Mojang on their website.

Firewall configuration for Client/LAN worlds

Most shared Minecraft worlds are hosted using dedicated Minecraft server. If this is how you want to host, see Server section below.

A simpler way is to allow others to join your current Minecraft game. When playing, your Minecraft client also allows others to join the game in progress. Your client automatically broadcasts the info about your game on port 4445. It will also listen for TCP connections on which other players join. This TCP listening port is picked at random every time you start Minecraft. This works well if you do not have a firewall. But if your firewall blocks incoming TCP connections, then it is very tricky to allow this random port in.

In conclusion, to allow your client to host a local LAN game, your firewall need to allow:

  • UDP port 4445 to broadcast your game
  • random incoming TCP port

See [1] for more information.

Bedrock Edition Server

This version allows the hosting of Bedrock Edition Minecraft, which is currently supported on Windows 10 and Mobile, Amazon FireOS and FireTV, Android and iOS, Xbox One, Playstation 4, Nintendo Switch and Samsung Gear VR devices.

Installation

The Bedrock Minecraft server can be installed via the minecraft-bedrock-server AUR package. It provides a systemd unit file. This package creates a separate minecraft-bedrock account.

Starting the server

To start the server you may either use systemd or run it directly from the command line. Using systemd you may start and enable the included minecraft-bedrock-server.service . Alternatively run the following as the minecraft-bedrock user inside the /opt/minecraft-bedrock-server directory:

Server Configuration

The configuration file server.properties contains the server settings and additional documentation. Most importantly, server-port determines the UDP port at which the server will listen for incoming connections. The default port is 19132 for IPv4, and 19133 for IPv6. UDP ports 43351 for IPv4 and 51885 for IPv6 are required for authentication.

Java Edition Server

Installation

The Java Edition Minecraft server can be installed via the minecraft-server AUR package. It provides additional systemd unit files and includes a small control script.

Also see #Alternative servers for an overview of alternative programs allowing to host Minecraft.

Setup

Introduction

In the installation process the minecraft user and group is introduced. Establishing a Minecraft-specific user is recommended for security reasons. By running Minecraft under an unprivileged user account, anyone who successfully exploits your Minecraft server will only get access to that user account, and not yours. However you may safely add your user to the minecraft group and add group write permission to the directory /srv/minecraft (default) to modify Minecraft server settings. Make sure that all files in the /srv/minecraft directory are either owned by the minecraft user, or that the user has by other means read and write permissions. The server will error out if it is unable to access certain files and might even have insufficient rights to write an according error message to the log.

The package provides a systemd service and timer to take automatic backups. By default the backups are located in the backup folder under the server root directory. Though to keep the disk footprint small only the 10 most recent backups are preserved (configurable via KEEP_BACKUPS ). The related systemd files are minecraftd-backup.timer and minecraftd-backup.service . They may easily be adapted to your liking, e.g. to follow a custom backup interval.

Читайте также:  Linux read only filesystem

Starting the server

To start the server you may either use systemd or run it directly from the command line. Either way the server is encapsulated in a tmux session which is owned by the minecraft user. Using systemd you may start and enable the included minecraftd.service . Alternatively run

Accepting EULA

In order to run the minecraft server you must accept the EULA. This only needs to happen once after installation. The EULA file resides under /srv/minecraft/eula.txt after being created by the package. You will need to edit this file to state that you have agreed to the contract in order to run the server. All you need to do is change:

to the value true. Here is an example of accepted EULA in /srv/minecraft/eula.txt :

Firewall Configuration for Server Worlds

There are three settings in the server.properties which determine ports that your server will use.

server-port determines the TCP port at which the server will listen for incoming connections. Default port is 25565 .

query.port determines the UDP port at which the server will share game info/advertising information. Default port is 25565 . Note that since server and query ports are TCP and UDP, they can share the same port. To enable query, you also have to specify enable-query=true .

rcon.port determines the TCP port if you choose to allow remote access to admin console. Default port is 25575 . To enable rcon, you also have to specify enable-rcon=true and rcon.password=. .

You will need to allow incoming connections at least on the server-port . It is advisable to allow query and its query.port . On the other hand, enabling remote console access is a security risk, and you should be careful of allowing it.

Above information is for the official Minecraft server. If you are using alternate server, please see its documentation for details about its configuration.

See [2] and [3] for more information.

Server management script

To easily control the server you may use the provided minecraftd script. It is capable of doing basic commands like start , stop , restart or attaching to the session with console . Moreover it may be used to display status information with status , backup the server world directory with backup , restore world data from backups with restore or run single commands in the server console with command do-something .

Tweaking

To tweak the default settings (e.g. the maximum RAM, number of threads etc.) edit the file /etc/conf.d/minecraft .

For example, more advanced users may wish to enable IDLE_SERVER by setting it to true . This will enable the management script to suspend the server if no player was online for at least IDLE_IF_TIME (defaults to 20 minutes). When the server is suspended an idle_server will listen on the Minecraft port using ncat(1) (also called netcat or simply nc for short; see Network tools#Netcat) and will immediately start the server at the first incoming connection. Though this obviously delays joining for the first time after suspension, it significantly decreases the CPU and memory usage leading to more reasonable resource and power consumption levels.

Alternative servers

Spigot (respectively Craftbukkit)

Spigot is the most widely-used modded Minecraft server in the world. It can be installed as spigot AUR via the AUR. The spigot PKGBUILD builds on top of the files from the minecraft-server AUR package. This means that the spigot server provides its own systemd unit files, spigot script and corresponding script configuration file. The binary is called spigot and is capable of fulfilling the same commands as minecraftd . The configuration file resides under /etc/conf.d/spigot .

Be sure to read #Setup and replace minecraftd with spigot wherever you encounter it.

It is somewhat affiliated with Bukkit and has grown in popularity since Bukkit’s demise.

Cuberite

Cuberite is a highly efficient and extensively moddable Minecraft server, written in C++ and Lua. It achieves much better performances than the vanilla Minecraft server, but is not fully compatible with the latest Minecraft client (some game aspects might be missing or not working).

Cuberite minecraft server can be installed as a cuberite AUR package, which provides a simple web interface by default at port 8080 with which most server operations can easily be done through the browser. The cuberite PKGBUILD builds on top of the files from the minecraft-server AUR package. This means that the cuberite server provides its own systemd unit files, cuberite script and corresponding script configuration file. The binary is called cuberite and is capable of fulfilling the same commands as minecraftd . The configuration file resides under /etc/conf.d/cuberite .

Be sure to read #Setup and replace minecraftd with cuberite wherever you encounter it.

PaperMC

PaperMC is a Minecraft server, compatible with Spigot plugins which aims to offer better performance. It can be installed via papermc AUR .

Читайте также:  Стол mario 120 carrara cer windows

Be sure to read #Setup and replace minecraftd with papermc wherever you encounter it.

Forge

Forge is a widely used Minecraft modding API. The following server packages are available:

Be sure to read #Setup and replace minecraftd with forged ( forge-x.x.xd for legacy versions) wherever you encounter it.

Fabric

Fabric is a lightweight, experimental modding toolchain for Minecraft. The server package can be installed via fabric-server AUR .

Be sure to read #Setup and replace minecraftd with fabricd wherever you encounter it.

Additional notes

  • There are several server wrappers available providing everything from automatic backup to managing dozens of servers in parallel, refer to Server Wrappers for more information. However the management script provided by the AUR packages should suffice most needs.
  • You might want to set up a systemd timer with e.g. mapper to generate periodic maps of your world.
  • Be sure to take periodic backups e.g. using the provided management script (see #Introduction) or plain rsync.

Minecraft mod launchers

You can launch Minecraft from different so called launchers that often include an array of mod packs to enhance one’s gameplay and add mods.

  • Feed The Beast — Originated as a custom challenge map in Minecraft that made heavy use of multiple tech mods and evolved into a mod package launcher.

https://www.feed-the-beast.com/ || ftbaAUR

  • MultiMC — Sandbox environment manager for separable pack association.

https://multimc.org/ || multimc-binAUR

  • Technic Launcher — Modpack installer with a focus on mod discovery via popularity rankings.

https://www.technicpack.net/ || minecraft-technic-launcherAUR

Other programs and editors

There are several programs and editors which can make your Minecraft experience a little easier to navigate. The most common of these programs are map generators. Using one of these programs will allow you to load up a Minecraft world file and render it as a 2D image, providing you with a top-down map of the world.

  • AMIDST (Advanced Minecraft Interface and Data/Structure Tracking) ( amidstAUR ) is a program that aids in the process of finding structures, biomes, and players in Minecraft worlds. It can draw the biomes of a world out and show where points of interest are likely to be by either giving it a seed, telling it to make a random seed, or having it read the seed from an existing world (in which case it can also show where players in that world are). The project has been forked in the past, of which the most notable one is «Amidst Exporter» ( amidstexporterAUR ) which includes a patch for calculating Ocean Monument locations in 1.8+ worlds.
  • Mapcrafter ( mapcrafter-gitAUR ) is a high performance Minecraft map renderer written in C++ which renders worlds to maps with an 3D-isometric perspective. You can view these maps in any webbrowser hence they are easily deployed on one’s server. Mapcrafter has a simple configuration file format to specify worlds to render, different rendermodes such as day/night/cave and can also render worlds from different rotations.
  • Minutor ( minutor-gitAUR ) is a minimalistic map generator for Minecraft. You are provided with a simple GTK based interface for viewing your world. Several rendering modes are available, as well as custom coloring modes and the ability to slice through z-levels.

Troubleshooting

Server on ARM devices

Minecraft server should run without any issues on ARM devices with latest Java, such as jre-openjdk-headless . However, if you encounter any issues, try using jdk-arm AUR instead. Also consider #Cuberite server as an alternative.

Client or server does not start

It might be the problem with Java version. Java version 8 is guaranteed to work well in all cases.

Both Minecraft server and the actual game work perfectly fine with the latest version of Java, such as jre-openjdk , but the Minecraft game launcher (and possibly all other mods) might only work with the Java version 8.

Broken fonts with MinecraftForge

Force Unicode fonts from the language menu.

Since you cannot read any of the menu options: in the main menu, choose the bottom-left most button is Options, second-from-the-bottom on the left side is the Language Button. From there, the Force Unicode Font button is on the bottom, on the left side.

MultiMC unable to build

If you are trying to install multimc5 AUR and get an error similar to:

The error could be caused by Java missing, which can be fixed by installing jdk8-openjdk . If the error is not fixed by that or Java was properly installed in the first place, the wrong version could still be the default environment:

You can set the default java version using archlinux-java set .

Cannot change pulseaudio sink

If you are unable to switch audio output device (indicated by DONT_MOVE flag in the output of pacmd list-sink-inputs ) then the following openalsoft config may help

Источник

Оцените статью