News Trending

How to Set Up a Minecraft Server on Raspberry Pi

ad+1

raspi-minecraft-server

Want to play Minecraft on your own terms? Set up your own server, create your own worlds, perhaps build in them with friends and family?

It’s remarkable, but true: you can do all of this on a Raspberry Pi.

My son is a big fan of Minecraft and is always wanting me to play alongside him. It’s not easy to do while he’s playing on his tablet. As he’s only young, allowing him online seems inappropriate.

The solution is simple: set up a Minecraft server a Raspberry Pi. It’s easy to set up!

What You Will Need

To build a Minecraft server on your Raspberry Pi, you will need:

  • A Raspberry Pi 3 (or later) and power cable. We’re assuming your Pi is in a case.
  • Ethernet cable (preferable to wireless networking).
  • 8GB or larger microSD card.

Although earlier Pi models can be used for this, the results aren’t as good. These instructions for the Raspberry Pi 3 and 4 will give you the best Minecraft server possible.

All of the above, when used with a remote SSH connection will let you set up your Pi as a Minecraft server. If SSH isn’t an option, you will also need:

  • USB keyboard
  • USB mouse (or a combination of both)
  • 1 x HDMI cable
  • A monitor or other compatible display

Connect these peripherals before powering on your Raspberry Pi.

You will also, of course, need a copy of Minecraft on your computer. Note that the system spec of the Raspberry Pi means that you won’t be able to host too many people. For the Pi 3, certainly don’t attempt to host more than 10.

What Sort of Minecrafter Is This For?

Minecraft hosted on a Raspberry Pi server

Several versions of Minecraft are available.

Creating this server will give you a world that you can access from any device running Minecraft, except, curiously, MinecraftPi. So, versions of Minecraft on a Windows PC, game console, Android, iOS, and Amazon Fire tablets and TV devices will work with this server.

As such, if you have several devices on your local network, these could all access the Minecraft server.

In short, you’ll need the main Minecraft open world game from Mojang.

Step 1: Install Raspbian and Configure Your Pi

Start off with a fresh copy of Raspbian. You’ll find the latest version at www.raspberrypi.org/downloads. Follow our guide to installing a Raspberry Pi operating system for the full steps. If this seems too complicated, then try the NOOBS installer instead.

Prefer to stick with your existing copy of Raspbian? Simply upgrade to the latest version and update your packages:

sudo apt update

sudo apt upgrade

Next, configure the Raspbian environment for running the Minecraft server. Did you set it up with a monitor and keyboard? If so, simply open the Raspberry Pi Configuration tool in the Preferences menu on the desktop.

If you’re accessing via SSH, use sudo raspi-config to open the text-based configuration tool.

Here, make the following changes:

  • Go to Advanced Options > Memory Split and change the setting to 16MB. This will free more memory resources for the server.
  • Next, go to Boot Options > Desktop/CLI and select Console. (No need to do this on Raspbian Lite.)
  • If you’re trying this with a Raspberry Pi 1 or 2, find Overclock on the main menu and set this to High. (Raspberry Pi 3 and 4 users can skip this step.)
  • Enable SSH in Advanced Options > SSH.
  • Finally, go to Advanced > Expand Filesystem.

With these changes made, go to Finish and reboot Raspbian at the prompt. Once done, login again, and find the IP address of the device with:

sudo hostname -I

Or:

ifconfig

Make a note of the IP address before continuing.

Step 2: Install the Minecraft Server

Installing Minecraft on the Raspberry Pi relies on the Nukkit server software. Developed specifically for Minecraft: Pocket Edition, Nukkit can be easily installed on the Pi via the command line.

Start by installing Java. This is required for Nukkit to run:

sudo apt install oracle-java8-jdk

Next create a new directory (labelled “nukkit”) then open it:

mkdir nukkit

cd nukkit

With that done, download the Nukkit server software. Be sure to enter this accurately—it’s easier to copy and paste into an SSH session.

wget -O nukkit.jar http://ci.mengcraft.com:8080/job/nukkit/lastSuccessfulBuild/artifact/target/nukkit-1.0-SNAPSHOT.jar

(You can find the most up-to-date builds at the project page.)

Once downloaded, run Nukkit:

sudo java -jar nukkit.jar

This prompts Nukkit to set up the server. When prompted, choose your language (we used eng) then watch as the Minecraft server is generated.

Step 3: Configure Your Minecraft Server

Once you know the server is setup correctly it’s time to configure it. Two configuration files are included with Nukkit: nukkit.yml and server.properties.

To edit these, simply open them in your preferred text editor. On Raspbian, nano is preinstalled, so use

sudo nano nukkit.yml

or

sudo nano server.properties

Various changes are recommended. Whatever you change here, keep in mind that the Pi is a modest device that cannot handle too much processing.

Configure your Minecraft server

A list of server properties can be found in the Minecraft wiki, but several should be edited right away. Start off with:

max-players=10

Older Raspberry Pi models will struggle with more than 10. You might be okay with 5-6 players. Several other options are available to configure that you might be interested in, such as:

pvp=on

This is for player vs. player action. There’s also a difficulty setting:

difficulty=1

Here, the easiest setting is 0.

When you’re done, press Ctrl + X to save and exit, then run:

sudo java -jar nukkit.jar

This will restart the Minecraft server software.

Step 4: Connect to the Raspberry Pi Minecraft Server

Your Minecraft server should now be online on your local network. Check this using a ping command from another device, using the IP address you noted down earlier. If the ping returns a response from your Raspberry Pi then you’re fine to continue.

All you need to do is launch Minecraft on your computer or tablet, then click Play > Servers. Here, Add Server, inputting the new server details, giving it a name, and adding the IP address. The port number should match the one listed in the server properties. If not, change it!

Connect to your Raspberry Pi Minecraft server

Your server should then be listed as an option to connect to. Simply select the server to start playing.

Step 5: Extend Your Minecraft Server Functions With Nukkit Plugins

The default configurations for the Nukkit server might not be wholly to your liking. Tweaking nukkit.yml and server.properties is one option, but will only get you so far.

Plugins have been developed for Nukkit that allow you to enhance the basic gameplay. This adds features to the online session that have been omitted, such as the inclusion of animals.

Suggested Nukkit plugins include:

  • MobPlugin: adds mobs and animals to the Minecraft environment
  • WorldEssentials: enables different game modes
  • EssentialsNK: includes additional game modes, multiplayer management tools, and more

These can be installed simply by downloading to your Raspberry Pi and moving them to the plugins directory.

For example, the MobPlugin can be moved with:

sudo mv MobPlugin-1.9.0.1.jar plugins

Head to the nukkitx.com website and click Resources to choose from over 250 plugins for your Raspberry Pi Minecraft server.

Minecraft Server Running on Your Raspberry Pi!

Minecraft can be installed on the Raspberry Pi

That’s all there is to it. Your very own Minecraft game server running on the Raspberry Pi. If you leave it up and running, you’ll have an always-on Minecraft world that you can connect to and use. A great solution for Minecraft-loving children, self-hosting the server on your local network keeps their online activity safe—at least as far as playing their favorite game goes.

Want to do more with your Raspberry Pi and games? Check our list of game servers that run on the Raspberry Pi.

Read the full article: How to Set Up a Minecraft Server on Raspberry Pi



from MakeUseOf https://ift.tt/2OEfkk5
via IFTTT

0 comments: