Apollo
Developers
Modules
Mod Setting

Mod Setting Module

Overview

The mod setting module allows you to interact with Lunar Client players mods and settings of those mods.

This module heavily integrates with our Options API. You can find all available mods and their options under the mods section.

  • Adds the ability to interact with Lunar Client mods.
    • Ability to enable/disable mods.
    • Ability to change, enable or disable mod settings within a mod.

Mod Settings Module Example

When mods are disabled on the server, players will receive a notification!

Integration

Sample Code

Explore each integration by cycling through each tab, to find the best fit for your requirements and needs.

Disable Lighting Mod

public void disableLightingModExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(apolloPlayer -> this.modSettingModule.getOptions().set(apolloPlayer, ModLighting.ENABLED, false));
}

Reset Lighting Mod to it's default value

public void rollbackLightingModEnabledState(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    // To rollback the server override value of the setting, simply set the value to "null"
    apolloPlayerOpt.ifPresent(apolloPlayer -> this.modSettingModule.getOptions().set(apolloPlayer, ModLighting.ENABLED, null));
}

Broadcast Disable Lighting Mod the an entire server

public void broadcastDisableLightingModExample(Player viewer) {
    this.modSettingModule.getOptions().set(ModLighting.ENABLED, false);
}