pauseSound()
pauseSound
Method in MelodyManager
Class
pauseSound
Method in MelodyManager
ClassThe pauseSound
method is used to pause a sound in the MelodyMine plugin. This method can pause a sound for a specific player or for all players, depending on the parameters passed.
Method Signature
Parameters
soundName
String
The name of the sound to be paused.
sendToAll
boolean
Determines whether the sound should be paused for all players or not.
socketID
String
The socket ID of the player for whom the sound should be paused. This is ignored if sendToAll
is true
.
Example
Here is an example of how to use the pauseSound
method in another plugin:
In this example, the pauseSoundForPlayer
method in the ExamplePlugin
class retrieves the MelodyPlayer
instance for the player using their UUID. It then uses the pauseSound
method of the MelodyManager
class to pause a sound for the player. If the sound is successfully paused, a message is logged to the console. If the player is not found, a warning is logged instead.
Last updated