minecraft server #13

Supports: bionic disco
Add to new model

Description

A minecraft server. You need to provide the minecraft .jar file as a resource.

Uses 'mcstatus' to get information from the server.

The running server can be managed/operated by screen.


Overview

Minecraft is the ever so popular game. This charm deploys a stand alone minecraft server for you.

You have to download the server jar first, which you attach as a resource.

The server needs about 2GB ram and 2 cpus to be happy (might need more).

Usage

  • Start by downloading the official server jar.

  • Deploy with the server jar as a juju resource:

juju deploy cs:~erik-lonroth/minecraft-server --constraints "mem=2G cores=2" --resource server-jar=minecraft_server.1.14.jar

juju expose minecraft-server

You can attach a server-jar after deploy also with juju attach-resource if you like to upgrade later for example.

juju attach-resource minecraft-server server-jar=minecraft_server.1.14.jar

The server runs default on port 25565 in survival mode.

If you enable the query-port with juju config, you can query the server with mcstatus.

Configuration

All configuration changes triggers a server restart.

Example, set gamemode and server-port like this:

juju config minecraft-server gamemode='creative' server-port=12345

Operating the server

The charm sets up a 'screen' session named 'minecraft' as the user minecraft.
You can attach to this at any time to operate the server.

For example:

juju ssh minecraft-server/0

sudo -u minecraft screen -R minecraft

# ctrl-a d (Gets you out)

Contact & Attribution

Erik Lönroth erik.lonroth@gmail.com - author of the charm

Nathan Adams at Mojang for the mcstatus code. dinnerbone+github@dinnerbone.com

All Minecraft developers for a great game!

Upstream Project Name


Configuration

allow_flight
(boolean) Allow players to fly, true or false
allow_nether
(boolean) Allow generation of the nether, true or false
True
difficulty
(int) Level of complexity 1-5
1
enable_query
(boolean) Allow quering the server, true or false
True
extra_packages
(string) Space separated list of extra deb packages to install.
gamemode
(string) survival|creative
survival
install_keys
(string) List of signing keys for install_sources package sources, per charmhelpers standard format (a yaml list of strings encoded as a string). The keys should be the full ASCII armoured GPG public keys. While GPG key ids are also supported and looked up on a keyserver, operators should be aware that this mechanism is insecure. null can be used if a standard package signing key is used that will already be installed on the machine, and for PPA sources where the package signing key is securely retrieved from Launchpad.
install_sources
(string) List of extra apt sources, per charm-helpers standard format (a yaml list of strings encoded as a string). Each source may be either a line that can be added directly to sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal Package Archives, or a distribution component to enable.
level_name
(string) Name of the level, will be generated if it doesn't exist
world
max_players
(int) Maximum players allowed on the server
10
motd
(string) Message of the day displayed to users in the server list
Juju Powered Minecraft Server
package_status
(string) The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
install
query_port
(int) Port for which Minecraft can be queried
25566
server-port
(int) Port for which Minecraft runs upon
25565
spawn_animals
(boolean) Generate animals, true or false
True
spawn_monsters
(boolean) Generate monsters, true or false
True