setPlayerDeafen()
setPlayerDeafen
Method in MelodyManager
Class
setPlayerDeafen
Method in MelodyManager
ClassThe setPlayerDeafen
method is a part of the MelodyManager
class. This method is used to set the deafen status of a player in the MelodyMine plugin. The deafen status determines whether the player can hear other players in the voice chat or not.
Method Signature
Parameters
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