Skip to content

The Minestom implementation for the bluedragonmc.com Minecraft server.

License

Notifications You must be signed in to change notification settings

BlueDragonMC/Server

Repository files navigation

Server

GitHub Workflow Status (with branch) GitHub last commit Jitpack CI Status

BlueDragon Logo

BlueDragon's Minestom implementation. It currently includes:

  • Creating isolated instances for different game types and modes
  • A modular system for adding functionality to games
    • This allows for a very high degree of code reusability and simplicity, and makes rapid prototyping of games very quick and easy.
  • System for handling player punishments
  • Database support linked to every Player using a player provider
  • Synchronization with other servers using gRPC messaging and a Mongo database
  • Routing players to the correct instance when they join
  • Separated, per-instance chat and tablist functionality
  • Basic commands

Minestom is a Minecraft server library targeted at developers. Their wiki is available here.

Usage

Build with ./gradlew build and run the JAR created at build/libs/Server-x.x.x-all.jar. Requires Java 21 or higher.

Development

This can be built as a docker container with the following command:

$ DOCKER_BUILDKIT=1 docker build -t bluedragonmc/server:testing .

This uses the Dockerfile in the current directory to build an image with the version string "testing". Note: A game named Lobby must be present for the server to run!

Environment variables:

  • PUFFIN_VELOCITY_SECRET - Your Velocity proxy forwarding secret (optional). If not specified, Mojang authentication will be enabled.
  • BLUEDRAGON_AGONES_HEALTHCHECK_INTERVAL_MS - The amount of time in between Agones healthcheck pings, in milliseconds.
  • BLUEDRAGON_AGONES_RESERVATION_TIME_MS - The amount of time in between Agones server reservations, in milliseconds.
  • BLUEDRAGON_AGONES_DISABLED - Disables Agones integration if set to any value.
  • BLUEDRAGON_ENV_TYPE - Set to "DEV" to enable development mode.
  • BLUEDRAGON_QUEUE_TYPE - Set to "IPC" to use Puffin or "TEST" for the TestQueue. If not present, a default value is inferred.
  • BLUEDRAGON_MONGO_CONNECTION_STRING - The connection string used to connect to MongoDB.
  • BLUEDRAGON_PUFFIN_HOSTNAME - The hostname used to connect to Puffin.
  • BLUEDRAGON_LUCKPERMS_HOSTNAME - The hostname used to connect to LuckPerms.
  • HOSTNAME - Used to determine the server name. Provided by default in Docker or Kubernetes environments.
  • SERVER_INSTANCE_MIN_INACTIVE_TIME - The amount of time that an instance must be inactive before it is cleaned up.
  • SERVER_INSTANCE_CLEANUP_PERIOD - The amount of time in between instance cleanup tasks.
  • BLUEDRAGON_PUFFIN_PORT - The port used to connect to Puffin. Defaults to 50051.
  • BLUEDRAGON_GRPC_SERVER_PORT - The port used to create a gRPC server. Defaults to 50051.

Tip

If you are running Puffin, Komodo, or multiple game server instances on the same machine without some kind of networking isolation, you must change the BLUEDRAGON_GRPC_SERVER_PORT environment variable for each server to prevent port conflicts.

Implementation

To learn how to integrate other server software with BlueDragon's systems, see the Integration Guide

Creating a Game

To learn how to create a game using this library, see our ExampleGame repository. It has guides and documentation for creating a simple game.

Project Structure

The project contains a common subproject, which is used by all games as an API to compile against. This subproject also contains many useful game modules that most games use.

The testing subproject contains testing fixtures and utilities for running automated tests.

The main subproject (in src/*) contains all the code necessary to start the server, load plugins, and connect with external services like databases and IPC/messaging systems. It also contains all the global commands and translations.