Interface VoiceDistanceEvent

All Superinterfaces:
Event, ServerEvent

public interface VoiceDistanceEvent extends ServerEvent
This event is emitted after a microphone packet arrives at the server and the distance is processed. This can be used to modify the distance at which other players can hear this packet.
  • Method Details

    • getPacket

      MicrophonePacket getPacket()
      Returns:
      the microphone packet
    • getSenderConnection

      VoicechatConnection getSenderConnection()
      Returns:
      the connection of the player
    • getDistance

      float getDistance()
      This returns either the default distance that's set on the server or the modified distance if another subscriber changed it already. In case a player is whispering, this will return the whisper distance. The whisper state can be obtained by calling getPacket() and getting MicrophonePacket.isWhispering().
      Returns:
      the distance in blocks
    • setDistance

      void setDistance(float distance)
      Sets the distance this player sends audio at. Note that this also includes the whisper distance, if the player is whispering.
      Parameters:
      distance - the distance in blocks