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.
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
ApolloPlayer
- The player you want to enable the staff mod for.
StaffMod.TYPE
- The type of staff mod(s) you want to enable for the
ApolloPlayer
player. See the staff mod types section for more.
- The type of staff mod(s) you want to enable for the
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
ApolloPlayer
- The player you want to disable the staff mod for.
StaffMod.TYPE
- The type of staff mod(s) you want to disable for the
ApolloPlayer
player. See the staff mod types section for more.
- The type of staff mod(s) you want to disable for the
StaffMod
Types
XRAY