setPlayerDeafen()
setPlayerDeafen
Method in MelodyManager
Class
setPlayerDeafen
Method in MelodyManager
ClassMethod Signature
Parameters
Parameter
Type
Description
melodyPlayer
MelodyPlayer
The player whose deafen status is to be set.
value
boolean
The deafen status to be set. If true
, the player will not be able to hear others in the voice chat. If false
, the player will be able to hear others.
Usage
To use this method in another plugin, you need to get an instance of the MelodyManager
class and call the setPlayerDeafen
method on it. Here is an example:
In this example, the deafenPlayer
method takes a Player
object and a boolean value. It retrieves the MelodyPlayer
object corresponding to the Player
and sets the deafen status of the MelodyPlayer
to the provided boolean value. It then logs the action to the console.
Last updated