Minecraft (MC) Forge 1.20.1 server build tutorial

Debian system uses the MCSManager9 panel to build a tutorial for Minecraft Java Edition MOD server. This tutorial uses the Forge1.20.1 server, and other servers can also be used for reference.

This tutorial uses Docker to run the mc server, which can easily switch between different Java versions and install multiple mc server versions.

Video tutorial: https://www.bilibili.com/video/BV13s4y1y7sC/

1.20 update contents

Version 1.20 is the first official version of Footsteps and Stories, and it is also a major update of Java Edition, released on June 7, 2023. The update was announced during Minecraft Live 2022, with the title of the theme revealed at the Minecraft Monthly on March 2, 2023. Some of its features have been developed in built-in packages since 22w42a.
This update adds many new blocks, items and mobs, such as Sakura Tree, Bamboo Mosaic, Sniffer, Smithing Template, etc. In addition, an archaeological element has been added, which can be used to clean up suspicious blocks with a brush and find pottery and other objects.

Introduction

Minecraft Forge is an open source API (Application Programming Interface) for Minecraft mod development and player use, which allows developers to create Minecraft-based mods that add new items, blocks, entities, crafting recipes, and more.

At the same time, the Minecraft Forge API also provides a way for players to manage and use mods. With the support of Minecraft Forge API, players can freely share, download and use mods created by other developers to add different content and gameplay to Minecraft.

Using the Minecraft Forge API, developers can create their own blocks, items, entities, synthesis recipes, and even modify the core code of the game to achieve a highly customized gaming experience. At the same time, developers can also create new dimensions and world generators, adding various new game mechanics and functions.

For players, the Minecraft Forge API can easily install and manage mods. Players only need to download the Minecraft Forge that suits their Minecraft version, and then put the mods they want to use into the mods folder of the game. These mods are used in the game.

Debian builds my world (MC) forge 1.19.3 server tutorial: https://blog.zeruns.tech/archives/699.html

Introduction to MCSM9

Distributed, stable and reliable, out of the box, highly scalable, supports control panels for Minecraft and a few other games.

The MCSManager panel (abbreviation: MCSM panel) is an open source, distributed, lightweight, fast-deployment management panel that supports most game servers and console programs.

This software has a certain popularity in Minecraft and other game communities. It can help you centrally manage multiple physical servers , dynamically create game servers on any host, and provide a safe and reliable multi-user permission system. Easily help you manage multiple servers, and has been providing healthy software support for Minecraft , Terraria, Steam game server administrators, operation and maintenance personnel and individual developers.

Prepare

First of all, you must have a server (you can ignore the existing ones). This tutorial uses the server of Teyu Cloud :

Official website address: https://url.vpszj.cn/teyucloud

Offer registration address: https://url.vpszj.cn/teyucloud_r

It just happened to be a month of special language cloud, so I used this as a tutorial.

Nimbus 13900K Suqian High Defense Cloud Server Performance Evaluation: https://blog.vpszj.cn/archives/1421.html

Nyuyun Suqian 5900X high-defense cloud server performance evaluation: https://blog.vpszj.cn/archives/1125.html

Pointing cloud Suqian 13900K high-defense VPS performance evaluation: https://blog.vpszj.cn/archives/1689.html

Minecraft Java Edition 1.17 and above have high requirements for single-core performance and memory. It is recommended to choose a server with high frequency and high single-core performance such as 5900X or 13900K. The recommended memory is 4G. If it is a MOD server or there are many people, you need to add more . It can also be upgraded after purchase. You can buy a low configuration first, and then upgrade if it is not enough.

I have already bought a server. This tutorial uses the Ningbo server of Teyu Cloud, and the operating system is Debian .

The default account is generally: the root password can be seen on the server console.

Other cost-effective and cheap VPS/cloud server recommendations: https://blog.zeruns.tech/archives/383.html

connect to the server

Download, install and open the ssh client software. The ssh client software recommends putty or mobaxterm.

Enter the IP address or domain name of your server in the SSH client, as well as the SSH port, and click Open.

If the warning shown below pops up, click Yes

Then enter the account number and press Enter, the account is usually root by default , then enter the password and press Enter to confirm, it will not be displayed when entering the password.

Reminder: In the SSH terminal, press and hold the left mouse button to select the text, then release the mouse, and then click in the blank space, so that the selected text will be copied; in the SSH terminal, right-click to paste.

open port

Go to the security group of the server console to open all ports, or only open the used ports (25565, 23333, 24444)

Then go back to the SSH terminal and enter the following commands to turn off the system's built-in firewall.

# 关闭防火墙,依次执行
systemctl stop firewalld
systemctl disable firewalld
service iptables stop

The following command prompts me that the firewall is not enabled, but it is executed as usual in order to ensure the smooth opening of the server.

Install the MCSM panel

Script Quick Install

Execute the following two commands, if you are asked whether to continue, enter y to confirm.

apt update && apt install wget && apt install git
sudo wget -qO- https://gitee.com/mcsmanager/script/raw/master/setup_cn.sh | bash
  • The script is only available for AMD64 architecture Ubuntu/Centos/Debian/Archlinux)
  • After the execution is complete, use systemctl start mcsm-{daemon,web}to start the panel service.
  • Use systemctl enable mcsm-{daemon,web}.serviceto enable autostart
  • The panel code and operating environment are automatically installed in /opt/mcsmanager/the directory.

Configuration file directory:data/SystemConfig/config.json

User data file directory:data/User/*.json

Remote daemon configuration file directory:data/RemoteServiceConfig/*.json

If a message similar to the one shown below is displayed, the installation is successful.

After the installation is complete, visit http://your server's ip or domain name: 23333/ to enter the panel.

After entering the panel, follow the prompts to set the account and password.

Linux manual installation of MCSM

  • If the one-click installation does not work, you can try this step to install manually. If the installation is successful, ignore this section.
# 切换到安装目录,没有此目录请执行 mkdir /opt/
cd /opt/
# 下载运行环境(已有 Node 14+ 可忽略)
wget https://npm.taobao.org/mirrors/node/v14.17.6/node-v14.17.6-linux-x64.tar.gz
# 解压文件
tar -zxvf node-v14.17.6-linux-x64.tar.gz
# 链接程序到环境变量中
ln -s /opt/node-v14.17.6-linux-x64/bin/node /usr/bin/node
ln -s /opt/node-v14.17.6-linux-x64/bin/npm /usr/bin/npm

# 准备安装目录
mkdir /opt/mcsmanager/
cd /opt/mcsmanager/

# 下载面板端(Web)程序
git clone https://github.com/MCSManager/MCSManager-Web-Production.git
# 重命名文件夹并进入
mv MCSManager-Web-Production web
cd web
# 安装依赖库
npm install --registry=https://registry.npm.taobao.org

# 返回上级目录
cd ..
# 下载守护进程(Daemon)程序
git clone https://github.com/MCSManager/MCSManager-Daemon-Production.git
# 重命名文件夹并进入
mv MCSManager-Daemon-Production daemon
cd daemon
# 安装依赖库
npm install --registry=https://registry.npm.taobao.org

# 安装nano编辑器
apt install nano

Then configure the Systemd service

Run the command nano /etc/systemd/system/mcsm-web.serviceto edit the service of the web panel, enter the following content, then press Ctrl + O and press Enter to save, and then press Ctrl + X to exit.

# /etc/systemd/system/mcsm-web.service
[Unit]
Description=MCSM 9 Web

[Service]
WorkingDirectory=/opt/mcsmanager/web
ExecStart=/usr/bin/node app.js
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

[Install]
WantedBy=multi-user.target

Run the command nano /etc/systemd/system/mcsm-daemon.serviceto edit the service of the web panel, enter the following content, then press Ctrl + O and press Enter to save, and then press Ctrl + X to exit.

# /etc/systemd/system/mcsm-daemon.service
[Unit]
Description=MCSM 9 Daemon

[Service]
WorkingDirectory=/opt/mcsmanager/daemon
ExecStart=/usr/bin/node app.js
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

[Install]
WantedBy=multi-user.target

Then start the service and set the boot to start automatically

# 重新载入变更
systemctl daemon-reload

# 设置开机自启
systemctl enable mcsm-{
    
    daemon,web}.service

# 启动服务
systemctl start mcsm-{
    
    daemon,web}.service

# 停止服务,正常情况不要运行此命令
systemctl stop mcsm-{
    
    web,daemon}.service

# 显示运行状况和日志
systemctl status mcsm-web.service
systemctl status mcsm-daemon.service -l

# 默认情况下,面板端会自动扫描 daemon 文件夹并且自动连接到守护进程。

If you do not see the daemon process after logging in to the panel, you can run the following command to get the key, and then manually add it to the panel as shown in the figure below.

cat /opt/mcsmanager/daemon/data/Config/global.json

127.0.0.1 in the figure below should be changed to your server public network IP or domain name.

Install Docker

Install with apt package manager:

# 安装docker,如果遇到问是否继续的就输入y来确定
apt install docker.io

# 设置docker开机自启和启动docker
systemctl enable docker && systemctl start docker

# 检查是否安装成功,若安装成功会显示 Docker version x.x.x
docker -v

If the installation is not successful, try the following installation script:

# 安装docker
curl -sSL https://get.daocloud.io/docker | sh

# 设置docker开机自启和启动docker
systemctl enable docker && systemctl start docker

# 检查是否安装成功,若安装成功会显示 Docker version x.x.x
docker -v

If it still doesn't work, try the manual installation tutorial linked below

Docker manual installation tutorial: https://url.zeruns.tech/docker

Docker to domestic source

# 创建或修改 /etc/docker/daemon.json 文件
apt install nano && nano /etc/docker/daemon.json

# 然后输入下面内容:(输入完后按Ctrl+O,然后回车保存,接着按Ctrl+X退出编辑器)
{
    
    
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

# 重启docker服务
systemctl restart docker.service

Install the JDK image

Enter the panel, find Image Management and click to enter.

Click New Image, and then click Create OpenJDK 17 environment image (JDK8 for versions 1.12.2 and below; JDK17 for versions 1.17 and above).


Click OK and wait for the build to complete

run server

First of all, we need to download a server core (.jar format). Here I take forge1.20.1 as an example.

forge official website: https://url.zeruns.tech/xRq44

forge-1.20.1-47.0.1 Baidu network disk download address: https://url.zeruns.tech/J5T3v

Click Application Instance→New Instance→Java Edition Minecraft Server→Upload a single server software


Enter a name you want to set, start the command input java -server -Dfile.encoding=UTF-8 -Duser.language=zh -Duser.country=CN -jar ${ProgramName} --installServer, and then click the upload server software below to select the jar file downloaded above.

Analyze the above startup command: -jarit means to run the jar program, fill in the name of the jar file to be run, and the latter ${ProgramName}represents the name of the file you upload next; --installServerit means to install the server; -Dfile.encoding=UTF-8the specified file code is UTF-8, which can avoid Chinese garbled characters Problem; -Duser.language=zh -Duser.country=CNthe specified language and region are Chinese and China, and some plug-ins or servers will automatically switch to Chinese.

This startup command is an installation command. Higher versions of forge, mohist, and fabric servers need to be installed first; official servers do not need to be installed first, but can be run directly, just remove the following command --installServer.

After the upload is complete, click Go to edit the specific parameters of the instance.

Select virtualization container as the process startup method, select mcsm-openjdk:17 as the environment image , and select host as the network mode . The maximum memory is set according to the memory size of your own server. It is recommended to set it a little smaller than the memory of your own server, leave some space for the system, and click Save after setting Configure , then click console .

Then click to open the instance and wait for the installation to complete. The domestic server may fail to download due to the special domestic network environment.

If the download and installation fails, download the compressed package linked below. I have already run and installed this compressed package. Upload the compressed package to the server and decompress it. Copy the decompressed file to the root directory, and then continue to edit run.sh below. file steps.

forge-1.20.1-47.0.1 Download the compressed package of the library file: https://url.zeruns.tech/B3vz9

If the download and installation is successful, the terminal will display the following information, and the file will also appear here when you click file managementrun.sh , as shown in the figure below

Click run.shthe edit button on the right side of the file, and then enter -server -Dfile.encoding=UTF-8 -Duser.language=zh -Duser.country=CNthe space as shown in the figure below. Click Save File when finished typing.

If you want to modify the maximum memory limit, edit user_jvm_args.txtthe file and # -Xmx4Gdelete the # in it (the # represents a comment), -Xmx4Gwhich means that the maximum memory is limited to 4G. You can change it to 8G or other values ​​yourself. It is recommended to set it smaller than the actual memory of your server a little.

Then go to the advanced instance settings and change the startup command to bash run.sh, save the configuration, go back to the instance console and click to start the instance again .

If the following line of information appears, you need to modify the eula.txt file to agree to the eula agreement.

Click Server Configuration File .

Then click Browse under [General] eula.txt , change the No of eula to Yes , then click Save Configuration, then click Return to the configuration file list to return to the console.

Click again to start the instance . If Done appears, it means that the server is started successfully.

Then click Specific Configuration → [General] server.properties , and then you can modify the server settings. For non-genuine users, remember to set the online genuine verification to No, and click Save after the settings are completed. After modification, restart the instance.


QQ group 2: 746189110

MC open server communication QQ channel: https://url.zeruns.tech/mc_qq

Minecraft server exchange TG group: https://t.me/Minecraft_zeruns

Minecraft service exchange community: https://bbs.csdn.net/forums/Minecraft

enter the game

Click Add Server in the game, enter your server’s public IP or domain name, and add the port number. The default port number is 25565. The IP and port are separated by a colon, as shown in the figure below.

recommended reading

Guess you like

Origin blog.csdn.net/u012513463/article/details/131253648