Tutorial:OpenBSD startup script

From Minecraft Wiki
Jump to navigation Jump to search
Script warning
The Minecraft Wiki is a website that can be edited by anyone. Although edits are usually checked by other wiki editors, it is possible for a malicious user to modify scripts and programs to behave maliciously. It is suggested that you should check the integrity of any script or program you run on your system.

This article describes how to install and launch Minecraft on OpenBSD using the packaged launcher, as well as how to run a dedicated server.

Installation

[edit | edit source]

Install the Java Development Kit and the Minecraft package:

$ doas pkg_add jdk minecraft

Run minecraft once and follow the instructions displayed in the terminal. The setup script runs only the first time the launcher is started. After the setup has completed, run minecraft again to launch the game.

Do not change the executable location in the launcher profile. On OpenBSD, the launcher must run from its installed location for Minecraft to start correctly.

Running a server

[edit | edit source]

Download the dedicated server .jar file from the Minecraft website and place it in a directory that is accessible to your user account.

Open a terminal, change to that directory, and start the server:

$ java -Xmx1024M -Xms1024M -jar minecraft_server.jar --nogui

To simplify starting the server, create a shell script:

$ nano minecraft_server.sh

Then enter:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar --nogui

Save the file and make it executable:

$ chmod +x minecraft_server.sh

The script can then be started with:

$ ./minecraft_server.sh

Alternatively, it can be run with:

$ sh minecraft_server.sh
[edit | edit source]