Our Private Minecraft Server (and that time my son burnt down my beautiful cottage)
I’ve bought a couple of Raspberry Pis in my time but I’m never really sure what to do with them. I’ve tried setting up those various emulators and things but can never seem to get them working properly. They end up sitting in drawers for ages.
Last year, we bought our son a Kid’s Kindle Fire for Christmas (although a fake, jolly fat-man that creeps around people’s houses in the middle of the night got all the credit) and it’s simultaneously the best thing we ever got him (when we’re in a restaurant or on a plane) and the worst thing we ever got him (when he insists on playing ‘Doors’ during dinner, a Roblox game which, if it’s possible to judge games on volume alone, must be fucking fantastic).
I thought it would be prudent to introduce him to the delights of Minecraft, a cartoony game that has some action elements but is a much more gentle romp based on creating things, not carnage. The game loop revolves around building various structures and making them look nice. He particularly enjoys building enormous houses out of diamond blocks, though I find them a touch garish. Maybe I just lack vision.
Minecraft starts by generating a landscape and even allows different people to connect to the same landscape so they can build things together. To do this you need a Minecraft server, a piece of software that can be downloaded for free and run on a home computer with enough juice. How much juice you need largely depends on how many people you’re going to invite to your server and what you want them to be able to do. Our server is just for us and it will sit within our local WiFi loop only, so we won’t need to convert our broom cupboard into a server room or hire an InfoSec team just yet.
The aforementioned Raspberry Pi seemed pretty perfect for this. It’s small, low-powered and I had no idea what else to do with it. The problem is that it can’t run the Bedrock server (the official Minecraft server software). The Raspberry Pi CPU is an ARM CPU, whereas Bedrock is compiled for Intel architectures.
I got around this by installing Ubuntu and running a Java version of the server called Nukkit. This seemed to work fine for a couple of months, but Nukkit is quite old and not quick to update whereas the Minecraft clients are updated quite often. A few times we would log on, only to be told that the server was out of date and I would have to download and extract a new version (when it was ready). In fact, one day, I was about to do this when I saw notice that the software had been retired and would no longer be updated, so we were kind of stuck.
Anyway, for £150 I purchased a mini-pc, a small computer that even comes with a bracket allowing you to fit it to the back of your desktop monitor. This thing had 16GB or RAM and an Intel Alder Lake N100 CPU. In fact, it was this one: https://www.amazon.co.uk/dp/B0CBTLZBS9?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1.
It came with Windows 11 installed but I installed Linux (POP_OS) alongside it because … well, you know … but also because I could operate it headless through SSH. Then I was able to install the Ubuntu version of the official Minecraft Bedrock Server, which was just a matter of extracting the archive and updating the server.properties
file so that it provides the kind of game we’re looking for (e.g. we only really like the Creative mode, and we like being able to teleport as we’re both given to wandering off and losing each other).
Next, I added three crontab entries (using the root
crontab)
The first entry starts the server at 06:00 each morning. Though my son is now (thankfully) a bit beyond the stages of waking up at stupid o’clock every day, it’s still nice to have it ready to go.
The second shuts it down at 22:00 at night. There didn’t seem to be a nicer way to send a quit
into the server, but a kill signal seems to work fine.
The third entry uses rtcwake
to put the computer into hibernation between the above times (with half-an-hour’s grace). This is to reduce power consumption, saving on electricity cost and the planet etc.
1
2
3
4
5
6
7
8
9
10
11
12
13
cakers@minecraft:~$ sudo crontab -l
[sudo] password for cakers:
# Start bedrock
0 6 * * * cd /home/cakers/minecraft/current && ./bedrock_server
29 15 * * * cd /home/cakers/minecraft/current && ./bedrock_server
# Stop bedrock
0 22 * * * pkill -f bedrock_server
# Hibernate for 7 hours overnight until 05:30 - half-hour before Bedrock starts
30 22 * * * rtcwake -m disk --date +420min
The only other thing I did was leave it out on my desk for a few hours, while it ran the server, to see if got particularly hot. I’m pleased to say that it didn’t get beyond luke-warm.
After that, I shoved it into our broom cupboard, plugged it in and left it running. It sits there unobtrusively and quite happy, allowing us to join and continue our private Minecraft game any time we like as long as we’re within range of our WiFi.
There was this time I’d built a beautiful cottage. Timber frame, nice wooden floors and properly cosy with all book-shelves, lanterns and what-not. My son was very appreciative, and decided a fireplace would top it off. He stuck one in while I was outside checking out his own efforts. Within five minutes my cottage had caught fire and burnt down. He ran laughing into his nice, safe diamond-bricked house while I surveyed the carnage. I wasn’t even insured.