Skip to content

Conversation

@ItsNature
Copy link
Collaborator

@ItsNature ItsNature commented Sep 4, 2025

Apollo for Minestom

Minestom is a modern, open-source Minecraft server that enables developers to build highly performant and flexible servers from the ground up. It operates as a library, rather than relying on a traditional plugin-based architecture.

Integrating Apollo with your Minestom server is straightforward. Instead of installing a plugin, you'll simply add the apollo-minestom artifact as a library dependency to your project and initialize the ApolloMinestomPlatform within your server's startup sequence.

Adding the Repository

First, you need to add the Lunar Client Maven repository to your build configuration.

build.gradle.kts

repositories {
    maven {
        name = "lunarclient"
        url = uri("https://repo.lunarclient.dev")
    }
}

build.gradle

repositories {
   maven {
       name = 'lunarclient'
       url = 'https://repo.lunarclient.dev'
   }
}

pom.xml

<repositories>
    <repository>
        <id>lunarclient</id>
        <url>https://repo.lunarclient.dev</url>
    </repository>
</repositories>

Adding the Dependency

Next, add the apollo-minestom dependency to your project.

build.gradle.kts

dependencies {
    implementation("com.lunarclient:apollo-minestom:1.2.0")
}

build.gradle

dependencies {
   implementation 'com.lunarclient:apollo-minestom:1.2.0'
}

pom.xml

<dependencies>
    <dependency>
        <groupId>com.lunarclient</groupId>
        <artifactId>apollo-minestom</artifactId>
        <version>1.2.0</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Initialization

To initialize Apollo, simply call ApolloMinestomPlatform.init(ApolloMinestomProperties.DEFAULT_PROPERTIES) in your server's startup code, before you start the server. This will set up all the necessary listeners and modules.

Here is an example of a simple Minestom server with Apollo integrated:

package com.lunarclient.apollo.example;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.ApolloMinestomPlatform;
import com.lunarclient.apollo.ApolloMinestomProperties;
import com.lunarclient.apollo.common.location.ApolloBlockLocation;
import com.lunarclient.apollo.event.EventBus;
import com.lunarclient.apollo.event.player.ApolloRegisterPlayerEvent;
import com.lunarclient.apollo.module.waypoint.Waypoint;
import com.lunarclient.apollo.module.waypoint.WaypointModule;
import com.lunarclient.apollo.player.ApolloPlayer;
import java.awt.Color;
import net.minestom.server.Auth;
import net.minestom.server.MinecraftServer;
import net.minestom.server.event.GlobalEventHandler;
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
import net.minestom.server.instance.InstanceContainer;
import net.minestom.server.instance.block.Block;

public final class ApolloMinestomExample {

    public static void main(String[] args) {
        MinecraftServer server = MinecraftServer.init(new Auth.Online());

        InstanceContainer instance = MinecraftServer.getInstanceManager().createInstanceContainer();
        instance.setGenerator(unit -> unit.modifier().fillHeight(-1, 0, Block.STONE));

        GlobalEventHandler eventHandler = MinecraftServer.getGlobalEventHandler();
        eventHandler.addListener(AsyncPlayerConfigurationEvent.class, event -> event.setSpawningInstance(instance));

        // Initialize Apollo
        ApolloMinestomPlatform.init(ApolloMinestomProperties.DEFAULT_PROPERTIES);

        // Display a Apollo Waypoint example
        EventBus.getBus().register(ApolloRegisterPlayerEvent.class, event -> {
            ApolloPlayer player = event.getPlayer();

            Apollo.getModuleManager().getModule(WaypointModule.class).displayWaypoint(player, Waypoint.builder()
                .name("KoTH")
                .location(ApolloBlockLocation.builder()
                    .world(player.getWorld().get().getName())
                    .x(500)
                    .y(100)
                    .z(500)
                    .build())
                .color(Color.ORANGE)
                .preventRemoval(false)
                .hidden(false)
                .build()
            );
        });

        server.start("0.0.0.0", 25565);
    }

    private ApolloMinestomExample() {
    }

}

Configuration

You can customize Apollo's behavior by passing a configured ApolloMinestomProperties object during initialization. While ApolloMinestomProperties.DEFAULT_PROPERTIES is sufficient for most use cases, you can tailor the settings to your server's specific needs.

Here’s an overview of the available properties and how to use them.

Properties

These properties control the core functionalities of Apollo on the Minestom platform.

sendRegisterPacket

  • Default: true
  • Description: Controls whether Apollo should send the minecraft:register packet for its plugin channel (lunar:apollo). Unlike other server platforms, Minestom does not manage a global registry of plugin channels, so this step is necessary for the client to recognize Apollo.
If you disable this, you are responsible for registering the `lunar:apollo` channel manually. Failure to do so will prevent Apollo from communicating with clients.
ApolloMinestomProperties.builder()
    .sendRegisterPacket(false)
    .build()

configPath

  • Default: ./Apollo/
  • Description: Specifies the directory where Apollo's configuration files are stored. By default, it creates an Apollo folder in your server's root directory. You can change this to integrate with your existing configuration structure.
ApolloMinestomProperties.builder()
    .configPath(Path.of("your/custom/config/path"))
    .build()

Commands

Apollo's in-game commands can be fine-tuned using the commandProperties builder. This allows you to disable commands or integrate with your own permissions system.

Since Minestom lacks a traditional, unified permissions API, Apollo provides a flexible predicate-based system. By default, it relies on Minestom's built-in operator permission levels.

  • Execute Commands (/apollo, /lunarclient): 2
  • Receive Apollo Available Update notifications: 4

Disabling Commands

ApolloMinestomPlatform.init(ApolloMinestomProperties.builder()
    .commandProperties(ApolloMinestomProperties.CommandProperties.builder()
        .registerApolloCommand(false)
        .registerLunarClientCommand(false)
        .build())
    .build());

Custom Permissions

ApolloMinestomPlatform.init(ApolloMinestomProperties.builder()
    .commandProperties(ApolloMinestomProperties.CommandProperties.builder()
        .apolloCommandPermission(sender -> sender.hasPermissionLevel(4))
        .lunarClientCommandPermission(sender -> sender.hasPermissionLevel(1))
        .build())
    .build());

Complete Example

Here is an example of a complete initialization call with custom properties:

ApolloMinestomPlatform.init(ApolloMinestomProperties.builder()
    .sendRegisterPacket(false)
    .configPath(Path.of("server-configs/apollo"))
    .commandProperties(ApolloMinestomProperties.CommandProperties.builder()
        .registerLunarClientCommand(false)
        .apolloCommandPermission(sender -> sender.hasPermissionLevel(4))
        .build())
    .build());

Review Request Checklist

  • Your code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have tested this change myself. (If applicable)
  • I have made corresponding changes to the documentation. (If applicable)
  • The branch name follows the projects naming conventions. (e.g. feature/add-module & bugfix/fix-issue)

@ItsNature ItsNature added type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition labels Sep 4, 2025
@ItsNature ItsNature mentioned this pull request Sep 4, 2025
@kermandev
Copy link

Shouldnt properties also include a configuration for the predicate if the sender could use a command? Id assume this would be better than relying on permission levels.

Also just having a T/F for registering commands to begin with.

@ItsNature ItsNature merged commit 7f3187a into version/1.2.0 Sep 12, 2025
2 checks passed
ItsNature added a commit that referenced this pull request Sep 15, 2025
* apollo minestom implementation

* minestom markdown docs

* publish minestom jar

* update javadoc version tags to 1.2.0

* Implement Minestom user metadata

* implement minestom properties & finish docs

* send the apollo version in the start server request

* add minestom to the download page

* remove unused imports

* fix update required version logic

* Remove gradle publish for the minestom branch

* Add command properties
ItsNature added a commit that referenced this pull request Sep 15, 2025
* Deploy as 1.2.0-SNAPSHOT

* Update adventure version (#232)

* Minestom Support (#231)

* apollo minestom implementation

* minestom markdown docs

* publish minestom jar

* update javadoc version tags to 1.2.0

* Implement Minestom user metadata

* implement minestom properties & finish docs

* send the apollo version in the start server request

* add minestom to the download page

* remove unused imports

* fix update required version logic

* Remove gradle publish for the minestom branch

* Add command properties

* Convert client brands & mods metadata to be a count-based system (#233)

* Bump to 1.2.0 (#235)

---------

Co-authored-by: Golfing7 <[email protected]>
@ItsNature ItsNature deleted the support/minestom branch September 26, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition

Development

Successfully merging this pull request may close these issues.

5 participants