Minecraft server enable to create a virtual world. Then you can connect from Minecraft from "Multiplayer".
Requirements
Installing Java is mandatory.
apt install default-jre screen nano wget git
apt install software-properties-common
apt install openjdk-16-jdk-headless
Init
Download the server binary located here : https://www.minecraft.net/fr-fr/download/server/.
Then you need to accept EULA by editing the file EULA.txt generated after launching the server for the first time.
Manual method
java -Xmx1024M -Xms1024M -jar minecraft_server.1.17.jar nogui
Screen method
Starting server :screen -S minecraft -d -m java -Xmx1024M -Xms1024M -jar server.jar nogui
Displaying launched program :
screen -ls
will list "screened" programsscreen -r minecraft
will show you the terminal where your program is launchedCtrl + a > c
will let you go back to your initial terminalService method
Install following code to /etc/systemd/system/minecraft_server.service :
[Unit]
Description=Minecraft server
[Service]
User=minecraft
# The configuration file application.properties should be here:
WorkingDirectory=/opt/minecraft/servers/myserver
ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar ./server.jar nogui
SuccessExitStatus=143
TimeoutStopSec=10
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Reload service file :
systemctl daemon-reload
Start :
service minecraft_server start
Stop :
service minecraft_server stop
Minecraft commands
To exit the program :/stop
For help :
/help
Aucun commentaire:
Enregistrer un commentaire