Ubuntu18.04 LTS minecraft server java edition construction memorandum

Note that it was surprisingly easy

Java check

I think that it is included by default, but I confirmed it for the time being. If it is not included, search for sudo apt search openjdk-11-jre and add a new one.

which java
# /usr/bin/java

jave --version
# openjdk 11.0.5 2019-10-15
# OpenJDK Runtime Environment (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04)
# OpenJDK 64-Bit Server VM (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04, mixed mode, sharing)

Download minecraft-server

Download the server of MINECRAFT: JAVA EDITION Get the latest version of jar from the top. For future version control, it's a good idea to rename it and specify version.

cd /tmp
curl -LOS https://...
chmod 700 server.jar
mv server.jar minecraft_server_1_15_1.jar

I ran it once for the time being

java -Xmx1024M -Xms1024M -jar minecraft_server_1_15_1.jar nogui

It fails with an error, but ʻeura.txt and server.properties are generated. In short, it's an error that you have to agree with ʻEURA, so let's agree.

eura.txt

eura.txt


.
..
...
eura=false #Change to true

server.properties

Server configuration file. You can change ʻiporport. The default port` is somehow scary, so I changed it. Let's change it according to each environment.

server.properties


 #Minecraft server properties     
 #Fri Jan 10 14:08:05 JST 2020
 broadcast-rcon-to-ops=true
 view-distance=10
 max-build-height=256
 server-ip=192.168.1.254 # default=
 level-seed=
 rcon.port=55575 # default=22275
 gamemode=survival
 server-port=55565 # default=22265
 allow-nether=true
 enable-command-block=false
 enable-rcon=false
 enable-query=false
 op-permission-level=4
 prevent-proxy-connections=false
 generator-settings=
 resource-pack=
 level-name=world
 rcon.password=
 player-idle-timeout=0
 motd=A Minecraft Server
 query.port=55565 # default=22265
 force-gamemode=false
 hardcore=false
 white-list=false
 broadcast-console-to-ops=true
 pvp=true
 spawn-npcs=true
 generate-structures=true
 spawn-animals=true
 snooper-enabled=true
 difficulty=normal # default=easy
 function-permission-level=2
 network-compression-threshold=256
 level-type=default
 spawn-monsters=true
 max-tick-time=60000
 enforce-whitelist=false
 use-native-transport=true
 max-players=2 # default=20
 resource-pack-sha1=
 spawn-protection=16
 online-mode=true
 allow-flight=false
 max-world-size=29999984

port open

Finally, open port. ʻUbuntu has a super useful tool called ʻufw, so let's use it.

sudo ufw allow from 192.168.1.0/24 to any port 55565
sudo ufw allow from 192.168.1.0/24 to any port 55575

Run again

Somehow warn will flow, but it will work for the time being (I want a solution) When actually operating it, let's pack it more and make it ** secure **.

java -Xmx1024M -Xms1024M -jar minecraft_server_1_15_1.jar nogui

#Below log

[15:15:42] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[15:15:42] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[15:15:42] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[15:15:42] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[15:15:42] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[15:15:42] [Server thread/INFO]: Starting minecraft server version 1.15.1
[15:15:42] [Server thread/INFO]: Loading properties
[15:15:42] [Server thread/INFO]: Default game type: SURVIVAL
[15:15:42] [Server thread/INFO]: Generating keypair
[15:15:43] [Server thread/INFO]: Starting Minecraft server on 192.168.1.254:55565
[15:15:43] [Server thread/INFO]: Using epoll channel type
[15:15:43] [Server thread/INFO]: Preparing level "world"
[15:15:43] [Server thread/INFO]: Reloading ResourceManager: Default
[15:16:48] [Server thread/INFO]: Loaded 6 recipes
[15:16:48] [Server thread/INFO]: Loaded 825 advancements
[15:16:49] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[15:16:51] [Server thread/INFO]: Preparing spawn area: 0%
...
[15:17:06] [Server thread/INFO]: Preparing spawn area: 97%
[15:17:06] [Server thread/INFO]: Time elapsed: 16974 ms
[15:17:06] [Server thread/INFO]: Done (82.928s)! For help, type "help"

I did it. The operation on the server side is over. However, with this method, if you close console or press ctrl-c, server will also drop, so it is better to run it in ** background ** or manage it with systemctld.

nohup java -Xmx1024M -Xms1024M -jar minecraft_server_1_15_1.jar nogui &

If you just want to move it for the time being, you can run it in the background by executing nohup ... & as above.

Connect from game

After confirming that the server actually worked, let's try multiplayer.

  1. Press multiplayer
  2. Add a server
  3. IP address: Enter the port
  4. Connect!

20200110153028_1.jpg

20200110153038_1.jpg

20200110153123_1.jpg

20200110153139_1.jpg

20200110153154_1.jpg

the end

Thank you for your hard work. By the way, is there any ** friends ** who can play minecraft together? ?? It seems to me that it is ** buggy and not implemented **, so thank you.

Reference / Citation / Source

-Set up a Minecraft multiplayer server on Ubuntu18.04 LTS

Recommended Posts

Ubuntu18.04 LTS minecraft server java edition construction memorandum
Server construction procedure Ubuntu18.04 server
Laravel environment construction (Ubuntu 18.04 LTS)
Set up a MineCraft Paper server on Ubuntu 20.04.1 LTS ② Update
Java memorandum
JAVA memorandum
Set Java version 11 of Docker Minecraft Paper server
Memorandum of new graduate SES [Java object-oriented edition]
Yes, let's make a Minecraft server (Ubuntu 20.04 + Bedrock Server)
Minecraft BE server development from PHP to Java
[Java] Environment construction
Java memorandum (list)
Java environment construction
NFS server construction
Java study memorandum
[Java] Optional memorandum
[Java] Let's create a mod for Minecraft 1.14.4 [Extra edition]
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)