Developer API
If you're building a companion plugin or a custom integration, here's how to hook in. The API is small on purpose — most extension points are events you can listen to without touching StarChat at all.
Maven dependency
pom.xml
<repository>
<id>starchat-public</id>
<url>https://repo.minestar.me/public/</url>
</repository>
<dependency>
<groupId>com.starplugins</groupId>
<artifactId>starchat-api</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
</dependency>Listen to filtered chat
java
@EventHandler
public void onFilter(StarChatFilterEvent event) {
Player player = event.getPlayer();
String original = event.getOriginalMessage();
FilterReason reason = event.getReason(); // SIMILARITY, FLOOD, BAD_WORD, …
int points = event.getPointsAwarded();
// Cancel the default punishment (StarChat won't escalate)
if (player.hasPermission("vip.bypass")) {
event.setCancelled(true);
}
}Send to staff chat from your code
java
StarChatAPI api = StarChatAPI.get();
api.staffChat().send(StaffChannel.MOD, "AntiCheat: " + player.getName() + " flagged for KillAura");Folia-safe scheduling
java
StarChatAPI.get().scheduler().runEntity(player, () -> {
// Runs on the player's region thread on Folia,
// or the main thread on Paper / Spigot.
player.sendMessage("hello");
});Inject custom placeholders
java
StarChatAPI.get().placeholders().register("kingdom", (player) -> {
return KingdomManager.getKingdom(player).getName();
});
// Used as %sc_kingdom% in any StarChat config.Why so small?
StarChat's extension points are intentionally minimal. The most common reason to hook in is to layer custom moderation or per-rank gating on top of the existing filter — both achievable as listeners without API surface. We add new methods only when the listener approach genuinely doesn't cover the case.