Interface VoiceDistanceEvent
- All Superinterfaces:
Event
,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 Summary
Modifier and TypeMethodDescriptionfloat
This returns either the default distance that's set on the server or the modified distance if another subscriber changed it already.void
setDistance
(float distance) Sets the distance this player sends audio at.Methods inherited from interface de.maxhenkel.voicechat.api.events.Event
cancel, isCancellable, isCancelled
Methods inherited from interface de.maxhenkel.voicechat.api.events.ServerEvent
getVoicechat
-
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 callinggetPacket()
and gettingMicrophonePacket.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
-