Apollo
Developers
Modules
Staff Mod

Staff Mod Module

Overview

The staff mod module allows you to interact with Lunar Client's built in staff mods.

  • Ability to grant and remove staff mods found in Lunar Client for players.
    • Ability to allow players to enable/disable the X-ray mod.

Staff Mod Module Example

Allow your staff to use hidden staff only mods, like xray!

Integration

How to enable staff mods for a player

public void enableStaffModsExample(Player viewer) {
    if (!viewer.hasPermission("apollo.staff")) {
        return;
    }
 
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(apolloPlayer -> this.staffModModule.enableStaffMods(apolloPlayer, Collections.singletonList(StaffMod.XRAY)));
}

enableStaffMods Parameters

  1. ApolloPlayer
    • The player you want to enable the staff mod for.
  2. StaffMod.TYPE
    • The type of staff mod(s) you want to enable for the ApolloPlayer player. See the staff mod types section for more.

How to disable staff mods for a player

public void disableStaffModsExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(apolloPlayer -> this.staffModModule.disableStaffMods(apolloPlayer, Collections.singletonList(StaffMod.XRAY)));
}

disableStaffMods Parameters

  1. ApolloPlayer
    • The player you want to disable the staff mod for.
  2. StaffMod.TYPE
    • The type of staff mod(s) you want to disable for the ApolloPlayer player. See the staff mod types section for more.

StaffMod Types

  • XRAY