Developer API

StarChat exposes a powerful Maven API allowing developers to intercept chat, trigger minigames, and modify player channels programmatically.

Adding the Dependency

You can include StarChat in your project via JitPack. Add the following to your pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.VicEntity</groupId>
        <artifactId>StarChat-API</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Listening to Custom Events

StarChat fires custom Bukkit events that you can listen to using standard event handlers.

Event ClassDescriptionCancellable
AsyncStarChatMessageEventFired when a player sends a message that has passed all filters. Contains the raw MiniMessage string.Yes
ChannelJoinEventFired when a player joins a specific chat channel.Yes
MinigameStartEventFired right before a Trivia or Math minigame begins broadcast.Yes

API Instance

// Get the main API instance
StarChatAPI api = StarChatProvider.getAPI();

// Dispatch a custom minigame manually
api.getMinigameManager().startMathEvent();

// Add a player to the global channel
api.getChannelManager().joinChannel(player.getUniqueId(), "global");