重启 Minecraft 服务器上的控制台。

huangapple go评论75阅读模式
英文:

restart console on Minecraft Server

问题

请原谅我不够经验,我对这个很新。我今天早些时候在Digital Ocean上为Minecraft设置了一个服务器。我运行了以下命令来使用java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar nogui创建了世界,并创建了一个screen。它让我进入了控制台,我可以输入像/op 和其他命令。之后,我关机了,现在当我尝试重新加入时,我不确定如何回到那个控制台。服务器上有多于1个人,有人正在控制台上 - 我不知道是否会引起任何问题。当我尝试用命令java -jar minecraft_server.jar打开控制台时,它说服务器已经在运行(确实是这样),但我只想回到控制台。

非常感谢。

英文:

Please excuse me for my inexperience, I am very new to this.
I set up a server on Digital Ocean for Minecraft earlier today. I ran the command to create the world with java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar nogui, and created a screen.
It gave me access to the console where I could type like /op <player-name> and other commands. Later on, I shut down, and now when I try to rejoin, I'm not sure how to get back to that console. I have more than 1 person on the server, who is on the console right now - I don't know if that should cause it any issue. When I retry to open the console with the command java -jar minecraft_server.jar It says there is already a server running (which there is) but I just want to get back to the console.

Thank you in advance.

答案1

得分: 2

如果这是一个Linux vserver或根服务器,您可以使用“screen”工具再次访问Minecraft控制台。

  1. 在服务器目录中创建一个新的启动脚本(start.sh)以启动JAR文件:
#!/bin/sh

screen -d -m -S "minecraft_screen" java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar nogui
  1. 打开您的终端并在目录中执行以下操作:
chmod +x start.sh
  1. 运行您的启动脚本:
./start.sh

要访问Minecraft屏幕,请使用命令“screen -r”。

要离开Minecraft屏幕,请按下Ctrl + A,然后再按下D

英文:

If this is a linux vserver or root server, you can use the "screen" tool to access the minecraft console again.

  1. Create a new startup script (start.sh) in the server directory to launch the JAR:

      #!/bin/sh
    
     screen -d -m -S &quot;minecraft_screen&quot; java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar nogui
    
  2. Open your terminal and execute the following in the directory:

     chmod +x start.sh
    
  3. Run your start up script:

     ./start.sh
    

To access the minecraft screen use the command "screen -r".

To leave the minecraft screen press <kbd>Ctrl</kbd> + <kbd>A</kbd> + <kbd>D</kbd>

答案2

得分: 0

作为登录到服务器的玩家,通过输入 /stop 命令停止服务器。这将停止并关闭服务器。现在返回到您的托管服务,并以与第一次相同的方式启动控制台。如果第一次是这样工作的,我可以想象第二次也会工作。

英文:

As a player logged into the server, stop the server by typing /stop. This will stop and close the server. Now proceed back to your hosting service and start the console the same way you did the first time. If it worked this way the first time, i can imagine itll work the second time.

答案3

得分: 0

只是备注一下,以防这对其他新服务器所有者有所帮助,截至撰写本评论时 - screen 已被弃用,tmux 是它的替代品。

  • 使用 'tmux' 创建一个 screen。
  • 使用 'ctrl+b' 然后 'd' 进行分离。
  • 使用 'tmux attach' 重新加入一个 screen。

我花了一些时间在互联网上搜索这个问题,所以我想在这里分享一下,如果这个问题过时了,不再相关,那我道歉。

英文:

just noting in case this becomes a resource for other new server owners, as of writing this comment - screen has been depreciated and tmux is it's replacement

  • use 'tmux' to create a screen
  • use 'ctrl+b' then 'd' to detach
  • use 'tmux attach' to rejoin a screen

i spent a little while searching the internet for this, so i thought sharing it here would be logical - apologies if this question is too outdated to still be relevant

huangapple
  • 本文由 发表于 2020年4月5日 11:46:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/61037782.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定