# cd /usr/ports/games/minecraft-server/
# make install clean
查看配置信息:
root@ykla:/usr/ports/games/minecraft-server # pkg info -D minecraft-server
minecraft-server-1.21.1:
On install:
When you first run minecraft-server, it will populate the file
/usr/local/etc/minecraft-server/eula.txt
It is required to read the EULA, and then set eula=true
- Configuration files can be found in /usr/local/etc/minecraft-server/
- Log and debug output files can be found in /var/log/minecraft-server/
- World files can be found in /var/db/minecraft-server/
Without daemon option:
- To run the server, run /usr/local/bin/minecraft-server # 运行方法
- To edit java's parameters, edit /usr/local/etc/minecraft-server/java-args.txt # java 参数
- To run with a specific version of Java, set environment variable JAVA_VERSION, # 指定某一 java 版本
for example:
export JAVA_VERSION=22
/usr/local/bin/minecraft-server
or:
JAVA_VERSION=22 /usr/local/bin/minecraft-server
With daemon option:
- The service has been installed with the name 'minecraft'
- To adjust maximum memory usage (-Xmx), use minecraft_memx= in /etc/rc.conf # 指定最大内存占用
- To adjust initial memory usage (-Xms), use minecraft_mems= in /etc/rc.conf # 指定初始化内存占用
- To add other java parameters, use minecraft_args= in /etc/rc.conf # 指定初始化参数
- To run with a specific version of Java, use minecraft_java_version= in /etc/rc.conf # 指定某一 java 版本
- To see the interactive console, type service minecraft console
$ /usr/local/bin/minecraft-server
…………省略一部分…………
[15:52:21] [ServerMain/WARN]: Failed to load eula.txt
[15:52:21] [ServerMain/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
root@ykla:/usr/ports/games/minecraft-server # /usr/local/bin/minecraft-server
Starting net.minecraft.server.Main
[18:47:47] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
[18:47:51] [ServerMain/INFO]: Loaded 1337 recipes
[18:47:51] [ServerMain/INFO]: Loaded 1448 advancements
[18:47:51] [Server thread/INFO]: Starting minecraft server version 1.21.3
[18:47:51] [Server thread/INFO]: Loading properties
[18:47:51] [Server thread/INFO]: Default game type: SURVIVAL
[18:47:51] [Server thread/INFO]: Generating keypair
[18:47:51] [Server thread/INFO]: Starting Minecraft server on *:25565
[18:47:51] [Server thread/INFO]: Using default channel type
[18:47:52] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[18:47:52] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
[18:47:52] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[18:47:52] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
[18:47:52] [Server thread/INFO]: Preparing level "world"
[18:47:52] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[18:47:53] [Worker-Main-5/INFO]: Preparing spawn area: 0%
[18:47:53] [Worker-Main-5/INFO]: Preparing spawn area: 0%
[18:47:53] [Worker-Main-5/INFO]: Preparing spawn area: 0%
[18:47:53] [Server thread/INFO]: Time elapsed: 1233 ms
[18:47:53] [Server thread/INFO]: Done (1.709s)! For help, type "help"
[18:48:34] [Server thread/INFO]: ykla[/127.0.0.1:37462] logged in with entity id 39 at (-1.5, 63.0, 1.5)
[18:48:34] [Server thread/INFO]: ykla joined the game