Set up a Minecraft resource (Spigot) server via docker

The true value of WSL2

ヾ (・ ω <) ノ "3 3 3 ● Ⅱ Ⅲ

------------------- ↓ Digression from here ↓ -------------------

Minecraft How many years have you touched it? (When the boat broke as soon as it hit) I remember quitting because the building I created was destroyed by a creeper.

I decided to touch it after a long time, Anyway, I want to be able to move between servers on multiple servers, Minecraft Start playing to set up a server (What are you doing (・ ω ・))

WSL2 is included, Let's install it on Linux. There seems to be a build, so let's use docker. Let's make mods available as well. Let's set up multiple servers. And the specifications became greedy, Only time will pass.

I managed to get it into shape, so I'll leave it here.


------------------- ↓ The main subject starts here ↓ -------------------

Advance preparation

It's natural to install Minecraft. I think Java Edition (Windows version) is fine. (It's not free!)

Assuming WSL2, Ubuntu and docker are included Look around here as well.

WSL2 + docker + PHP Windows development environment construction (1) WSL2 edition WSL2 + docker + PHP Windows development environment construction (2) docker edition

Success if the following command is passed from PowerShell

PS C:\> wsl -d Ubuntu-20.04
$ docker --version
Docker version 19.03.13, build 4484c46d9d

Cut the directory for data storage

$ mkdir ~/minecraft_data

Container generation from docker

There seems to be a server mod called Spigot. (I don't understand) spigot docker finds another, but This is adopted because it seems that it can be set only with parameters for those who are often used

itzg/minecraft-server

$ docker run -d -v ~/minecraft_data:/data -p 25565:25565 -e TYPE=SPIGOT -e EULA=TRUE --name mc itzg/minecraft-server
#Plugin specification-e MODS=http://hogehoge.com/plugin01.jar,http://hogehoge.com/plugin02.jar
#Seed value specification-e SEED=7314490960418706833

It starts up quickly, but It takes additional downloads, biome generation, etc. Wait about 3 minutes (˘ω˘) Soo ...

Start confirmation

Start Minecraft and try connecting with "Direct Connection" from Multiplayer.

Minecraft 1.16.3 2020_10_09 9_04_25_r.png

Minecraft 1.16.3 2020_10_09 9_04_13_r.png

Minecraft 1.16.3 2020_10_09 9_14_31_r.png

Check the connection.

Minecraft 1.16.3 - Multiplayer (3rd-party Server) 2020_10_09 15_32_31_r.png

Good login (`・ ω ・ ´)

Another world generation

Add plugin

I will write a detailed explanation about the plug-in later. I will write only what I need here.

$ docker stop mc
$ cd ~/minecraft_data/plugins
$ wget http://ci.onarandombox.com/job/Multiverse-Core/Release%20Build/artifact/target/Multiverse-Core-4.2.2.jar #Multi-world management
$ wget http://ci.onarandombox.com/job/Multiverse-Portals/Release%20Build/artifact/target/Multiverse-Portals-4.2.0.jar #Move between worlds
$ wget https://ci.lucko.me/job/LuckPerms/lastStableBuild/artifact/bukkit/build/libs/LuckPerms-Bukkit-5.1.107.jar #Plugin permission management
$ docker start mc

(˘ω˘) Soo ...

(゚ д ゚) Hah!

Plugin permission adjustment

If your username is Dozo

$ docker exec -i mc rcon-cli
> lp user Dozo permission set luckperms.* true
> lp user Dozo permission set minecraft.command.* true
> lp user Dozo permission set multiverse.* true
> ^C (ctrl+c)

No response from the console, but this is fine as long as the user name is correct

Log in to Minecraft and execute the following command

/gamerule doDaylightCycle false

Success if you can do it This is a time stop command that prevents the night from coming and being killed by zombies while working

World generation

Now that everything is ready, let's call it world generation. It can be generated on rcon-cli, but I don't really feel it, so I'll do it on Minecraft

/mv create asset NORMAL
Starting creation of world 'asset'...
Complete!

This created a new world named asset To move is the following command

/mvtp asset

When I try to create a nether and move it

Minecraft 1.16.3 - Multiplayer (3rd-party Server) 2020_10_10 12_58_03_r.png

Alright! It's a success! (`・ Ω ・ ´)


------------------- ↓ Click here for the postscript ↓ -------------------

Plugin settings

There is plugins in the storage directory, By putting the pre-built plugin file (jar) here, You can add plugins The ** data storage directory ** that was a little at the beginning of the article comes in handy here.

The flow is to clone and build with maven, It's easier and better to use the pre-built one directly.

The plugin creator who writes seems to publish Jenkins, Let's borrow from there. At that time, get from *** stable build *** instead of the latest build

Multiverse-Core [Jenkins] - Vivaldi 2020_10_09 12_43_58_rr.png

Multi-world

Multiverse

Multiverse was created at the dawn of Bukkit multiworld support. It has since then grown into a complete world management solution including special treatment of your nether worlds with Multiverse NetherPortals.

In the second delivery of Multiverse, we've broken it up into several smaller plugins that are each feature packed but not bloated! Multiverse provides the easiest to use world management solution for your Minecraft server, big or small, and with great addons like Portals and NetherPortals, what's not to love!

Multiverse is here and works for the latest server build! Is your server a Multiverse? https://dev.bukkit.org/projects/multiverse-core/

A plugin that manages multiple servers. You can enjoy the benefits of multiple servers such as creating worlds, recreating them, and moving between servers. Various plug-ins

name Details Jenkins URL
Multiverse-core Multi-server core system http://ci.onarandombox.com/view/Multiverse/job/Multiverse-Core/
Multiverse-Portals Build a portal for server-to-server movement http://ci.onarandombox.com/view/Multiverse/job/Multiverse-Portals/
Multiverse-NetherPortals For the above nether http://ci.onarandombox.com/view/Multiverse/job/Multiverse-NetherPortals/
Multiverse-Inventories Inventory management between servers http://ci.onarandombox.com/view/Multiverse/job/Multiverse-Inventories/

Should I put them all in anyway?

$ cd ~/minecraft_data/plugins
$ wget http://ci.onarandombox.com/job/Multiverse-Core/Release%20Build/artifact/target/Multiverse-Core-4.2.2.jar
$ wget http://ci.onarandombox.com/job/Multiverse-Portals/Release%20Build/artifact/target/Multiverse-Portals-4.2.0.jar
$ wget http://ci.onarandombox.com/job/Multiverse-NetherPortals/Release%20Build/artifact/target/Multiverse-NetherPortals-4.2.1.jar
$ wget http://ci.onarandombox.com/job/Multiverse-Inventories/Release%20Build/artifact/target/Multiverse-Inventories-4.2.1.jar

Click here for world generation parameters https://github.com/Multiverse/Multiverse-Core/wiki/World-properties

Command on Minecraft or RCON.

$  docker exec -i mc rcon-cli
> mvlist
§d====[ Multiverse World List ]====
§fworld§f§f - §aNORMAL
§fworld_the_end§f§f - §bTHE_END
§fworld_nether§f§f - §cNETHER

> mv create asset NORMAL
Starting creation of world 'asset'...
Complete!

> mv modify set weather false asset
§aSuccess!§f Property §bweather§f was set to §afalse

> mvrule doDaylightCycle false asset
§aSuccess!§f Gamerule §bdoDaylightCycle§f was set to §afalse§f.

> mv modify add creeper monsters asset
§aSuccess! §bcreeper§f was §cremoved from §amonsters

> mv create farm NORMAL -t FLAT
Starting creation of world 'farm'...
Complete!

> mv modify set gamemode creative farm
§aSuccess!§f Property §bgamemode§f was set to §acreative

> mv modify set difficulty hard farm
§aSuccess!§f Property §bdifficulty§f was set to §ahard

> mv modify set hunger false farm
§aSuccess!§f Property §bhunger§f was set to §afalse

Server management

LuckPerms

LuckPerms is a permissions plugin for Minecraft servers. It allows server admins to control what features players can use by creating groups and assigning permissions. https://luckperms.net

A plugin that manages server permissions, etc.

name Details Jenkins URL
LuckPerms https://ci.lucko.me/job/LuckPerms/
$ cd ~/minecraft_data/plugins
$ wget https://ci.lucko.me/job/LuckPerms/lastStableBuild/artifact/bukkit/build/libs/LuckPerms-Bukkit-5.1.107.jar

The LuckPerms plugin doesn't set an admin user by default, so After restarting, access the minecraft console and register as a user. If your username is Dozo

$ docker restart mc
$ docker exec -i mc rcon-cli
> lp user Dozo permission set luckperms.* true
ctrl+C

I don't know if it's a bug, but there is no response when I enter it, It's working properly. Connect with the client to check the operation

/lp editor

Minecraft 1.16.3 - Multiplayer (3rd-party Server) 2020_10_09 20_50_45_r.png

If you click the URL provided to access it, you will be taken to the Web UI for changing permissions. Various settings can be made. For the time being, it's like setting this much and making fine adjustments.

group name Authority
Admin minecraft.command.ban minecraft.command.pardon some.cool.admin.perm someplugin.vanish
Mod minecraft.command.mute minecraft.command.unmute some.cool.mod.perm chatcolor.bold
Default minecraft.command.say minecraft.command.me

reference: Using WSL2 in a Docker Linux container on Windows to run a Minecraft Java Edition

Recommended Posts

Set up a Minecraft resource (Spigot) server via docker (2)
Set up a Minecraft resource (Spigot) server via docker
Set up a Samba server with Docker
[Part 1] Let's set up a Minecraft server on Linux
Set up a mail server using Twisted
Set up a simple HTTPS server in Python 3
Set up a simple HTTPS server with asyncio
Set up a test SMTP server in Python.
Set up a UDP server in C language
Set up a local server with Go-File download-
How to set up a local development server
Set up a simple SMTP server in Python
Set up a simple local server on your Mac
Set up a free server on AWS in 30 minutes
[Vagrant] Set up a simple API server with python
Set up a web server with CentOS7 + Anaconda + Django + Apache
Creating a Flask server with Docker
Set up Ubuntu as a Linux cheat sheet and https server
Send mail with mailx to a dummy SMTP server set up with python.
Set up a local web server in 30 seconds using python 3's http.server
Set up a server that processes multiple connections at the same time
Start a simple Python web server with Docker
I want to set up a mock server for python-flask in seconds using swagger-codegen.
Set up a file server using samba on ZeroPi of Friendly Arm [Purchased Items]
Set up a file server using samba on ZeroPi of Friendly Arm [Personal import]