Rich Presence Module
Overview
The rich presence module allows you to interact with Discord and Lunar Client's launcher rich presence.
- Display various information about gamemodes and your server on player's rich presence.
- Ability to display different gamemode related attributes;
- Gamemode Name
- Gamemode Variant
- Current Game State
- Current Player State
- Map Name
- Team Size Attributes
- Ability to display different gamemode related attributes;
Your server must be a part of Lunar Client's ServerMappings to use this module.
Integration
Sample Code
Explore each integration by cycling through each tab, to find the best fit for your requirements and needs.
Override Rich Presence
public void overrideServerRichPresenceExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> {
this.richPresenceModule.overrideServerRichPresence(apolloPlayer, ServerRichPresence.builder()
.gameName("BedWars")
.gameVariantName("Solo")
.gameState("In Game")
.playerState("Playing")
.mapName("Winter")
.subServerName("BW02")
.teamCurrentSize(3)
.teamMaxSize(4)
.build()
);
});
}
Reset Rich Presence
public void resetServerRichPresenceExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.richPresenceModule::resetServerRichPresence);
}
ServerRichPresence
Options
.gameName(String)
the name of the game the player is playing on.
.gameName("BedWars")
.gameVariantName(String)
the variant of the game the player is playing on.
.gameVariantName("Solo")
.gameState(String)
the state of the current game.
.gameState("In Game")
.playerState(String)
what the player is currently doing in the game.
.playerState("Playing")
.mapName(String)
the name of the map the player is playing on.
.mapName("Winter")
.subServerName(String)
the sub server name of the server the player is playing on.
.subServerName("BW02")
.teamCurrentSize(Integer)
the current size of the player's team.
.teamCurrentSize(3)
.teamMaxSize(Integer)
the max size of the player's team.
.teamMaxSize(4)