VoiceChat Filters

Filters can be used to block some players from hearing each-other in proximity voicechat

VoiceChat Filters

Control voice communication permissions between players based on various conditions. Filters can restrict who can hear whom beyond simple proximity.

Built-in Filters

Configure these filters in plugins/OpenAudioMc/config.yml

vc-filter.require-same-gamemode

Only allows voice communication between players in the same gamemode

Useful for minigames to prevent communication between players in different states

vc-filter.require-common-team

Only allows communication between players on the same vanilla team

Perfect for team-based minigames to prevent enemy team communication

vc-filter.require-no-channel

Excludes players from proximity chat while in a channel

When disabled, players in channels can still interact with nearby players. When enabled, channel members only hear other channel members.

Developer Implementation

Important Considerations

  • Must be lightweight due to frequent calls
  • Filtered pairs receive no voice events or communication
  • No effect on static API peers
  • Runs off main thread - limited Bukkit API access
  • False return blocks connection, true may be overruled by other filters

Example Implementation

Gamemode Filter Example:

VoiceApi.getInstance().addFilterFunction(new CustomPlayerFilter() {
    @Override
    public boolean isPlayerValidListener(Player listener, Player speaker) {
        return listener.getGameMode() == speaker.getGameMode();
    }
});

Note: CustomPlayerFilter is a @FunctionalInterface and can be implemented as a lambda

Javadoc related to this feature (currently based on the dev branch)