[JAVA] Minecraft server on Raspberry Pi 4

"Make a Minecraft server on AWS" https://qiita.com/nanbuwks/items/601832b2da00b451d55d

Then, it worked without a hitch, so let's make a Minecraft server with Raspberry Pi 4 based on that knowledge.

environment

--Raspberry Pi 4 Model B 4GB (I verified it with Raspberry Pi 3 Model B, but it feels harsh)

Installation

Use this method to write to the micro SD card

"Writing a Raspian ZIP file to a microSD card on Ubuntu Linux" https://qiita.com/nanbuwks/items/2c296549ff72dacf7adc

Also, create ssh in / boot

Initial setting

The initial settings after logging on are


$ sudo apt update
$ sudo apt upgrade

After,


$ sudo raspi-config

As

"Raspberry Pi initial settings with CUI (if you have a display and keyboard)" https://qiita.com/nanbuwks/items/9a1d46c22e898178015c

I did it like this.

In addition, it seems that keyboard settings cannot be made with ssh.

Fixed IP address

When using it as a server, it is convenient to keep the IP address fixed.


sudo vi /etc/dhcpcd.conf

And add the following to the end of the file:


interface eth0
static ip_address=192.168.42.104/24
static routers=192.168.42.1
static domain_name_servers=192.168.42.1

After saving is completed, restart with the following.


$ sudo reboot

Log back in at 102.168.42.104.

Install Java

I used the latest one provided by Raspbian.


sudo apt install openjdk-11-jre

Start-up

Start as follows


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

This is fine for testing, but if you want to keep it running for a long time, it is better to add & at the end, use it in a screen session, or make it a full-scale automatic start setting or service. ..

When I ran it on Raspberry Pi 4 Model B (4G), it started in about 2 minutes as follows.


[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[20:29:36] [Server thread/INFO]: Starting minecraft server version 1.15.2
[20:29:36] [Server thread/INFO]: Loading properties
[20:29:36] [Server thread/INFO]: Default game type: SURVIVAL
[20:29:36] [Server thread/INFO]: Generating keypair
[20:29:37] [Server thread/INFO]: Starting Minecraft server on *:25565
[20:29:38] [Server thread/INFO]: Using default channel type
[20:29:38] [Server thread/INFO]: Preparing level "world"
[20:29:39] [Server thread/INFO]: Reloading ResourceManager: Default
[20:30:10] [Server thread/INFO]: Loaded 6 recipes
[20:30:27] [Server thread/INFO]: Loaded 825 advancements
[20:30:28] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:35] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:36] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:36] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:36] [Server thread/INFO]: Preparing spawn area: 48%
[20:30:49] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:49] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:49] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:54] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:54] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:54] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:55] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:55] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:56] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:56] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:57] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:57] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:58] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:58] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:59] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:00] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:00] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:00] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:01] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:01] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:02] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:02] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:03] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:03] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:04] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:31:04] [Server-Worker-3/INFO]: Preparing spawn area: 84%
[20:31:05] [Server-Worker-3/INFO]: Preparing spawn area: 84%
[20:31:05] [Server-Worker-3/INFO]: Preparing spawn area: 86%
[20:31:06] [Server-Worker-2/INFO]: Preparing spawn area: 91%
[20:31:06] [Server-Worker-1/INFO]: Preparing spawn area: 91%
[20:31:07] [Server-Worker-1/INFO]: Preparing spawn area: 92%
[20:31:07] [Server-Worker-2/INFO]: Preparing spawn area: 93%
[20:31:08] [Server-Worker-3/INFO]: Preparing spawn area: 95%
[20:31:08] [Server-Worker-3/INFO]: Preparing spawn area: 98%
[20:31:09] [Server thread/INFO]: Preparing spawn area: 99%
[20:31:09] [Server thread/INFO]: Time elapsed: 41122 ms
[20:31:09] [Server thread/INFO]: Done (90.443s)! For help, type "help"
[20:31:13] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2008ms or 40 ticks behind

Try to play

Try moving it and make sure it's okay.

Published outside the Internet

I will omit the details, but it is OK if you set the public of TCP25565 and UDP25565 to the router etc.

Bonus Log when running on Raspberry Pi 3

When I first ran it on a Raspberry Pi 3, it worked, but it seemed to be quite painful.


[19:23:59] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[19:23:59] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9,
 0 0 0]
[19:24:00] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[19:24:00] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[19:24:00] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[19:24:00] [Server thread/INFO]: Starting minecraft server version 1.15.2
[19:24:00] [Server thread/INFO]: Loading properties
[19:24:00] [Server thread/INFO]: Default game type: SURVIVAL
[19:24:00] [Server thread/INFO]: Generating keypair
[19:24:07] [Server thread/INFO]: Starting Minecraft server on *:25565
[19:24:07] [Server thread/INFO]: Using default channel type
[19:24:08] [Server thread/INFO]: Preparing level "world"
[19:24:10] [Server thread/INFO]: Found new data pack vanilla, loading it automatically
[19:24:10] [Server thread/INFO]: Reloading ResourceManager: Default
[19:26:04] [Server thread/INFO]: Loaded 6 recipes
[19:26:06] [Server thread/INFO]: Loaded 825 advancements
[19:26:56] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[19:26:57] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:26:57] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:26:57] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:26:58] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:26:58] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:26:59] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:26:59] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:00] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:01] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:01] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:01] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:02] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:02] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:03] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:03] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:04] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:04] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:05] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:05] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:06] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:06] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:07] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:07] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:08] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:08] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:09] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:09] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:10] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:10] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:11] [Server-Worker-2/INFO]: Preparing spawn area: 1%
[19:27:11] [Server-Worker-3/INFO]: Preparing spawn area: 1%
[19:27:12] [Server-Worker-3/INFO]: Preparing spawn area: 1%
[19:27:12] [Server-Worker-2/INFO]: Preparing spawn area: 1%
・
・
・
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:30] [Server-Worker-3/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-1/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-3/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-2/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-1/INFO]: Preparing spawn area: 97%
[19:29:30] [Server thread/INFO]: Time elapsed: 153775 ms
[19:29:30] [Server thread/INFO]: Done (321.899s)! For help, type "help"
[19:29:32] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2159ms or 43 ticks behind
[19:30:05] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 17806ms or 356 ticks behind
[19:34:58] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 7821ms or 156 ticks behind
・
・
・

Recommended Posts

Minecraft server on Raspberry Pi 4
Radiko recording server on Raspberry Pi 4 (Docker unused)
Install Docker on Raspberry Pi
Put Ubuntu 20.04.1 on Raspberry Pi 4
Install MariaDB on Raspberry Pi OS
Build a Minecraft server on AWS
Try putting CentOS 8 on Raspberry Pi 3
Headless install of Ubuntu 20.10 on Raspberry Pi
I installed Docker on my Raspberry Pi 3
Install CentOS 7 on Raspberry pi 4 Model B
Launched Redmine with Docker on Raspberry Pi 3
Serially connect to Ubuntu on Raspberry Pi
Install Ubuntu Core 18 on Raspberry Pi 2 Model B
Install Docker on Raspberry Pi 4 and Raspberry Pi OS 64bit
Send emails using Docker container on Raspberry Pi 3
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
How to run javafx with Raspberry Pi Posted on 2020/07/12
Play down with Raspberry PI4 as a server. Part 2
Display characters on I2C 1602 LCD with Raspberry Pi 3 & Java
Build VNC Server on Ubuntu 20.04
Install Docker on Ubuntu Server 20.04
Set up a MineCraft Paper server on Ubuntu 20.04.1 LTS ② Update
Install Ubuntu Server 20.04 on Btrfs
Install Cloud9 on Raspberry pi 4 and set up Rails development environment
Install Docker and docker-compose on Raspberry Pi 4, Linux (Debian) and Windows 10, respectively
20.10 is better than 20.04 for USB booting Ubuntu on Raspberry Pi 4B
Display user-defined characters on the I2C 1602 LCD with Raspberry Pi 3 & Java