BuildContest plugin automatically creates Minecraft sub-servers using Docker and transfers players to their respective contest servers.
BuildContest is a Velocity plugin that simplifies the setup of dedicated servers for each team in a building contest. The plugin uses Docker Compose to start sub-servers and automatically transfers players to their respective sub-servers for the contest. Team configurations and server information are persistently stored.
Prepare the Environment
Create a Minecraft Contest Server Image (Sub-Server)
25565 and ensure it can be accessed correctly via the proxy, including proper forwarding-mode settings.docker build -t minecraft-contest:latest .docker-compose.yml file for starting the sub-server.Download the Plugin
Configure the Plugin
plugins/ directory of Velocity.Configure Files
config.yml in the plugins/BuilderContest/ directory to set up ports and other settings.docker-compose-default.yml in the plugin directory as the template for starting sub-servers.Start the Server
bearer-token from the generated config.yml.config.yml
ktor:
http-port: 8080 # HTTP service port.
port-start: 30000 # Starting port for sub-servers.
bearer-token: # Bearer Token; leave this empty on first use.
allow-host: "*" # Allowed host addresses.
docker-compose-default.yml Example
#SERVER_NAME_PLACEHOLDER as the placeholder for the Docker container name.#SERVER_PORT_PLACEHOLDER as the placeholder for the port.version: '3.8'
services:
minecraft_server:
image: minecraft-contest:latest
container_name: "#SERVER_NAME_PLACEHOLDER"
ports:
- #SERVER_PORT_PLACEHOLDER:25565
volumes:
# Mount the local world directory to the specified path in the container
- ./worlds/#SERVER_NAME_PLACEHOLDER/world:/app/world
environment:
EULA: "TRUE"
restart: unless-stopped
8080 by default.POST /team/add, requires Bearer Token authentication, with teamId, teamName, and members as payload fields.curl --location --request POST 'http://localhost:8080/team/add' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sSCj4piDoEfV2zIo_C8lD7S4ul0YlVOyBr2BkKpdsTI (Retrieve this from config.yml)' \
--data-raw '{
"teamId": "team_1",
"teamName": "Team 1",
"members": ["Hanamizu_", "user1"]
}'