Skip to content

Latest commit

 

History

History
279 lines (268 loc) · 20.8 KB

README_jp.md

File metadata and controls

279 lines (268 loc) · 20.8 KB

マインクラフト 統合版(bedrock edition)サーバー構築ツール

※ 統合版とbedrock editionの2つの呼び方がありますがここではbedrock editionに統一しています。

このツールは Ubuntu / Debian サーバー上でマインクラフトサーバーを構築し、マインクラフトの自動アップデート、自動バックアップ、自動起動が設定できます。
詳しいインストール方法はこちら: https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/

ツールの特徴

  • 公式のマインクラフト bedrock edition サーバー(アルファテスト中)を構築します
  • マインクラフト bedrock edition サーバーの完全インストールが数分で完了
  • Ubuntu / Debian ディストリビューション下の動作がサポートされています
  • マインクラフトをOSのシステムサービスに登録し、OS起動時にマインクラフトが自動起動するように設定可能
  • サーバー再起動時、自動バックアップ
  • マルチインスタンスに対応 -- 同一システム上で複数の Bedrock サーバー が起動できます。
  • サーバー起動時に最新版への自動アップデート
  • start.sh, stop.sh and restart.sh ,これらのスクリプトで簡単操作
  • "logs" ディレクトリへタイムスタンプのログが可能
  • cron を利用して、毎日の再起動が設定可能

インストール方法(簡易版)

インストールのコマンド:
curl https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh | bash

インストールガイド

Minecraft Bedrock Dedicated Server Script Installation / Configuration Guide

RTX用リソースパックのインストール

リソースパック(RTXサポート)のインストール方法→step by step Minecraft Bedrock Dedicated Server Resource Packs / Optional RTX guide here.

テストが完了しているディストリビューション

  • Ubuntu / Ubuntu Server 20.04
  • Ubuntu / Ubuntu Server 18.04
  • Debian Stretch / Buster

テストが完了しているハードウェア環境

  • All PC X86_64 (稼働中)
  • Udoo X86 (稼働中)
  • Intel Compute Stick (稼働中)
  • Other X86_64 platforms (稼働中)
    • ARM 64bit (稼働中 -- 仮想化のために、リンカと他のバイナリをアップデートする必要があります)
      • Raspberry Pi (稼働中, 動作は遅いです, OSはUbuntu , セグメンテーション違反が起きるため、Pi OS 64 bitでは動きません)
      • Tinkerboard (稼働中, 動作は遅いです)

マルチサーバーとインストールパスについて

複数ワールドの. SetupMinecraft.sh を再度実行する際は、初回起動時と同じディレクトリパスで実行してください。 ディレクトリパスの構成は $ROOTPATH/minecraftbe/yourservername です。そのため、SetupMinecraft.sh がアクセスするディレクトリパスは常に同じにしなければならないです。

マイクラサーバーのフォルダ名は "server name" として入力した名前になります. スクリプ上で存在していればマインクラフトのアップデートは機能します。 もしも、新しいフォルダーでサーバーを作成した場合のパスは $ROOTPATH/minecraftbe/newservername. となります。

すべてのワールドのサーバーのインストールは同じパスにしてください。同一にすることでワールドを管理します

systemd権限を追加(オプション)

マインクラフトをsystemdサービスとして追跡しているユーザーについて、毎日の自動再起動機能を使用している場合。restart.sh はrootとして起動せず、systemd サービスとして再起動しません、よって、サービスは"online"と表示しません。

これを修正するには sudoers ファイル (sudo visudo) に下記コードを加えてください:

yourusername ALL=(ALL) NOPASSWD: /bin/systemctl start yourservername

This will give you

アップデート履歴

  • November 2nd 2021
    • Fixed extra / in front of permissions fix script (thanks MarkBarbieri, issue #109)
  • October 31st 2021
    • Fixed missing sudo from fixpermissions line in start.sh (thanks MarkBarbieri, issue #109)
    • Fixed missing -a parameter from /etc/sudoers file addition thanks MarkBarbieri, issue #109)
  • August 1st 2021
    • Updated documentation and root path selection prompt to make it more clear that the root directory should be the same for ALL servers
    • Don't change unless installing to a different disk, and then use the same root path for ALL servers as they will follow the structure $ROOTPATH/minecraftbe/yourservername
    • Choosing a perfect storm of invalid paths has resulted in people's server files being pruned before from being off by one folder sublevel etc. Please follow instructions carefully here and do not change it and make sure you have backups (saved outside of the main Minecraft backups folder) before ever trying to install an additional server or updating existing scripts.
    • Fortunately this person was starting a new server so the pruning didn't get anything serious but I can't stress enough to leave the paths alone unless you're legitimately an expert with a use case like having an entire separate disk for all the Minecraft servers. Use the same root directory every time (preferably the default)!
  • July 27th 2021
    • Cleaned up SetupMinecraft.sh and removed redundant code by organizing code into functions
    • Scripts now fix all server file permissions on startup
    • Added /etc/sudoers.d/minecraftbe file to contain passwordless sudo permission for fixpermissions and sudo systemctl start server
  • July 21st 2021
    • Updated documentation and restart.sh to document how to enable systemd's service showing as "online" after called by restart.sh (useful for people tracking the servers using the systemd service) by adding a line to the sudoers file to allow passwordless sudo for the sudo systemctl start yourservername command. Restart.sh now has commented lines at the bottom along with instructions on how to enable if you need this functionality (most people probably won't)
    • Added error redirection to crontab line to help diagnose failures during scheduled restarts and removed ExecStartPre from the service as it wasn't doing anything (run ./fixpermissions.sh if you need to fix the permissions) and caused compatibility issues with older systemd versions
  • July 17th 2021
    • Added in check to ensure start.sh and other scripts are not being ran as root. If this happens you have to use sudo screen -r to find the screen and the permissions will be wrong since root isn't the owner of the server files
    • If you know you ran the script/server as root (which starts creating files owned by root instead of the regular user) and your server won't start/is wonky run the fixpermissions script from your server folder with ./fixpermissions.sh and it will correct them for you!
  • July 15th 2021
    • Added update.sh convenience script to run SetupMinecraft.sh to update everything to the latest version
    • Added validation loop for directory path -- if you are upgrading from an old version you should use the default directory.
    • Nothing good can come from changing this and I've never seen or heard of it solving a single problem despite being requested for years (especially if you don't understand relative vs fully qualified Linux paths and other pitfalls -- leave it default!).
    • Attempting to solve this problem with safety checks in case this is useful to some people and I just haven't heard about it but it may be removed entirely or turned into a check that you have to download and modify the script to enable if it continues to be a source of strife for people.
    • Updated depends.zip for Raspberry Pis
  • July 4th 2021
    • Added missing sudo line to some prerequistes and removed apt-get install sudo as the script no longer runs as root (install sudo if missing) - thanks Rick Horn
  • July 3rd 2021
    • Added Accept-Encoding: Identity header to curl as a very small % of users are getting an "Access Denied" error without this header (thanks titiscan, pull request #95
    • Added default language header to curl as non-english computers were getting an Access Denied error
    • Script now checks for gawk being present in start.sh. If it's not installed (likely due to reusing old SetupMinecraft.sh files) timestamps will be disabled. This will prevent the server from failing to start. This is avoided by not running an old copy of SetupMinecraft.sh!
    • Removed broken screen -r command at the end of SetupMinecraft.sh as fixing it actually causes lockups -- instead now gives the command (screen -r) to pull up the Minecraft console. Press Ctrl+A then Ctrl+D to hide the console once you're inside it.
    • Added code to prevent SetupMinecraft.sh from being ran as a local file (please use the new method of curl https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh | bash)
  • July 2nd 2021
    • Improved dependency detection and installation
    • Removed wget dependency
    • Added gawk dependency -- this should not have any impact on most systems but on systems that use mawk by default this will fix server startup issues related to timestamps since mawk doesn't support strftime
    • Fixed stop.sh's -t countdown option (thanks da99Beast, issue #76)
    • Fixed a nasty issue where the installation of libcurl3 over the top of libcurl4 was allowed in some configurations (like Ubuntu 18.04) and was clobbering curl (thanks Goretech)
    • Fixed an issue where empty folders could be created in the wrong location if start.sh was not ran from the server folder (thanks CobraBitYou, issue #93
  • July 1st 2021
    • Changed from wget to curl as wget is freezing (but curl works)
    • Added randomization to user agent
  • June 19th 2021
    • Fixed timestamps to display on every line (thanks murkyl)
    • Added chmod command after unzip line to make bedrock_server executable for issue #22 (thanks murkyl)
    • Merged pull request #91 from starkey-01 to add prompt for an alternate installation directory. This has been requested for a while so thanks starkey-01!
    • Merged pull request #88 clarifying instructions to run script as non-root user (thanks sparagi!)
  • May 23nd 2021
    • The fixpermissions.sh script now displays the last 5 lines from the latest log file to aid in troubleshooting. If your server won't start this script often will take care of it and the logs can give useful information otherwise!
  • May 22nd 2021
    • Added setting the path variable to each script to prevent service from failing to start due to not being able to find the right path.
    • Please redownload SetupMinecraft.sh for this update. The script will give you a warning each time you start up that it couldn't set the path variable without the new SetupMinecraft.sh script
    • Added user agent to wget string to prevent update check from failing
    • Added automatic update to SetupMinecraft.sh if it has not been modified for more than 7 days
    • Updated Raspberry Pi dependencies
  • April 22nd 2021
    • Added a safety check to prevent installing on 32 bit (i386 or i686) operating systems. The official Bedrock dedicated server has only been released as a 64 bit (x86_64) binary and attempts at emulation on 32 bit have failed to yield any successful results!
    • Added chmod +x bedrock_server to start.sh as updates seem to be removing executable permissions sometimes
    • Fix removing old backup directory context (thanks murkyl, issue #76)
  • April 20th 2021
    • Fully qualified route command with /sbin/route to alleviate network check breaking some servers
    • Added safety check to prevent using the server label 'minecraftbe' which can break the scripts
    • Added libc6 dependency check as several people have reported libns1.so.1 missing
    • Added curl and libcurl3 dependency as a fallback for older distros to avoid missing libcurl.so errors
    • Added libcrypt1 dependency check
  • April 7th 2021
    • If you are updating from an old version make sure you remove the old SetupMinecraft.sh and redownload the new version from scratch. If you are seeing something like userxname in the systemd service you're using an old version of SetupMinecraft.sh and need to download the latest
    • Updated fixpermissions.sh -- can fix issues with permissions if you are seeing them!
    • Fixed a bug with userxname appearing in start.sh and not being updated to the correct username
    • Fixed an issue that could trigger PAM authentication in start.sh
  • March 16th 2021
    • Fixed a incomplete sudo line in start.sh that was throwing an error (thanks /u/zfa from reddit!)
  • February 1st 2021
    • Added fixpermissions.sh utility script to take ownership of Minecraft server files manually (the systemd startup service does this automatically for you if you are using it)
  • January 31st 2021
    • Added .\ in front of the screen -q checks to prevent similar usernames from tripping up window detection
    • Server now takes ownership of server files on each start to prevent folks a whole heap of trouble and heartache when restoring backups/moving files/etc.
  • December 20th 2020
    • Added experimental QEMU support for 32 bit (i386, i686) similar to how the ARM support works
  • December 18th 2020
    • Added safety check to prevent the script from being ran as root or sudo. This would cause the script to be installed to the /root folder.
    • If you know what you are doing and want to override just edit the check out of SetupMinecraft.sh but otherwise just run it as ./SetupMinecraft.sh normally.
    • Fixed a nasty bug that could cause start.sh and stop.sh to disapper (thanks Paul and James). This was related to log pruning and not having a hard path. If you downloaded the SetupMinecraft script in the past 3 days update and try again here and you'll be set!
  • December 15th 2020
  • December 13th 2020
    • RTX beta is now supported as long as you aren't on the "beta" channel anymore. Unenroll from the RTX beta and downgrade to normal Minecraft. RTX is in normal Minecraft now.
    • Fixed ARM support for Raspberry Pi, Tinkerboard, and others. Be warned, it's still very slow on ARM!
    • Updated depends.zip
  • December 10th 2020
    • Cleaned up documentation
    • Added notice that the RTX beta version of Minecraft's dedicated server has not been released yet. Support will be added the moment it is!
    • Added alpha software notice for Bedrock dedicated server per issue 34
  • November 17th 2020
    • Fixed server autoupdating in start.sh
    • Minecraft.net had made a change where the "--spider" parameter would return a 503 -- removed this to fix automatic updates
  • July 24th 2019
    • Fixed Raspberry Pi support
  • July 10th 2019
    • Fixed OpenSSL error in 1.12 (thanks obviator!)
    • Fixed ports not choosing defaultS if nothing is entered (thanks sweavo!)
  • July 2nd 2019
    • Added libcurl4 Bedrock server dependency to installer script to prevent server startup from failing
  • July 1st 2019
    • Added support for multiple servers
    • Choose the folder name and port for the server in SetupMinecraft.sh (must be unique per server instance)
  • May 23rd 2019
    • Fixed typo in restart.sh where there was a space after stop command preventing the server from closing cleanly
    • Added 10 second sleep after a force close to give the server time to fully close before calling start.sh
    • Fixed server not restarting after scheduled nightly reboot (related to restart.sh bug)
    • Removed some direct (for example paths like /bin/sleep) that were harming cross platform compatibility
  • April 26th 2019
    • Tested new Bedrock dedicated server 1.11.1.2
    • Added startup counter to server instead of waiting a flat 4s to reduce unnecessary waiting
    • Fixed ARM support (64 bit required)
  • April 18th 2019
    • Changed StopChecks++ to StopChecks=$((StopChecks+1)) to improve portability (thanks Jason B.)
    • Added TimeoutStartSec=600 to server to prevent it being killed if taking longer than usual to download server
  • March 7th 2019
    • Added Armbian support
    • Tested with Tinkerboard
    • Fixed portability issue with route vs /sbin/route
  • March 2nd 2019
    • Running the SetupMinecraft.sh script after already installing now updates all scripts and reconfigures the minecraftbe service
    • Script now works on any Debian based distribution (Ubuntu, Debian, Raspbian, etc.)
    • Added *very slow* support for ARM platforms such as Raspberry Pi with QEMU emulation of x86_64
    • Renamed service to minecraftbe to avoid confusion with Java version
  • February 15th 2019
    • Backups now compress into .tar.gz format (saved in backups folder)
    • Startup service waits up to 20 seconds for an internet connection to allow time for DHCP to retrieve an IP address
    • Removed unnecessary sleep time on stop.sh script so it returns as soon as the minecraft server closes
  • February 8th 2019
    • Initial release