LoginSignup
2
2

AndroidスマホでTermuxでマイクラサーバー(PaperMC)を起動する方法

Last updated at Posted at 2024-01-08

今回はAndroidスマホのTermuxというアプリでマイクラサーバーであるPaperMCを起動する方法について書いていく。

事前準備

あらかじめルータの画面でスマホのローカルIPアドレスをポート開放設定をしておく。
開けておくポートは25565と19132。
そしてスマホのWi-Fi設定でスマホのローカルIPアドレスを固定しておく。
これは検索して調べてみよう。

Termuxのダウンロード

以下のページからTermuxのF-Droidストアのボタンをタップすることでダウンロード出来る。

Termux | The main termux site and help pages.
https://termux.dev/en/

Termuxの起動

Termuxをタップして起動しよう。

ubuntu-in-termuxのダウンロードと起動

以下のURLの「【活用編】Ubuntuの導入」のところを参照するとubunutu-in-termuxがダウンロード出来る。

個人的Termuxのセットアップメモ
https://zenn.dev/ryuu/scraps/6b2584294674b7

Termuxを開いた状態で、以下のコマンドを1行ずつ入力してEnterを押す。

# パッケージの更新
apt-get update && apt-get upgrade -y

# wget・proot・Gitのインストール
#すでにpkgでインストールしている場合はスキップ可
apt-get install wget proot git -y

# ホームディレクトリに移動
cd

# スクリプトをクローン
git clone https://github.com/MFDGaming/ubuntu-in-termux.git

# 作成されたディレクトリへ移動
cd ubuntu-in-termux

# スクリプトに実行権限を付与
chmod +x ubuntu.sh

# インストールスクリプトを実行
./ubuntu.sh -y

# Ubuntu を起動
./startubuntu.sh

# Ubuntu が起動
root@localhost:~#

OpenJDK19のインストール

以下のページでは(Termux上でインストールする為)openjdk-17となっているが、ubuntu-in-termuxを起動した状態で以下のコマンドを入力すると良い。

Androidスマホで完結!Minecraftサーバ立上げてAndroidで接続 #Android - Qiita
https://qiita.com/tatuya911/items/840107699190451a4651

apt install openjdk-19-jdk

PaperMCの起動

PaperMCはダウンロードしたいバージョンの上でリンクをコピーをするとURLがコピー出来る。

Paper Downloads | PaperMC
https://papermc.io/downloads/paper

mkdir /data/data/com.termux/files/home/minecraft
cd /data/data/com.termux/files/home/minecraft
wget https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/381/downloads/paper-1.20.4-381.jar
java -jar paper-1.20.4-381.jar nogui

起動したらストップコマンドを入力して決定をタップ

stop

vimのインストール

vimをインストールしてeula.txtを編集可能な状態にしよう。

apt install vim
vim eula.txt

Eula.txtに同意する

iキーを押して挿入モードになる
矢印キーでeula=falseのfalseを削除してeula=trueにする
Escを押して:wqを入力して保存して終了するコマンドをEnterする
そして2回目のPaperMCの起動

java -jar paper-1.20.4-381.jar nogui

入るIPアドレスは自宅で接続する場合はポート開放時に設定したローカルIPアドレスだ。

外出時からアクセスする場合はグローバルIPアドレスを調べると良い。

アクセス情報【使用中のIPアドレス確認】
https://www.cman.jp/network/support/go_access.cgi

入るポート番号はPaperMCはJAVA版なので25565。

統合版からアクセス出来るようにする

統合版からもアクセス出来るようにするには、Geyser-SpigotとFloodgate-Spigotをダウンロードすれば良い。

stop

GeyserMC: Download
https://geysermc.org/download

プラグインのダウンロード

pluginディレクトリに移動して、wgetコマンドでGeyser-SpigotとFloodgate-Spigotをダウンロードしよう。

cd plugins
wget https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
wget https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot

server.propertiesを変更

最後にserver.propertiesで記述を変更する必要がある。

cd
cd minecraft
vim server.properties

enforce-secure-profileの変更

iキーを押して挿入モードになる。
矢印キーで

server.properties
enforce-secure-profile=true

これをfalseに変更する。

server.properties
enforce-secure-profile=false

Escを押して保存して終了する。

:wq

起動確認

3度目の起動をする。

java -jar paper-1.20.4-381.jar nogui

これで統合版でスマホサーバーに参加が可能になった。
統合版からアクセスする場合は自宅の場合はローカルIPアドレス、外出時からアクセスする場合はグローバルIPアドレス、ポート番号は19132。

2
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2