pauseSound()
pauseSound
Method in MelodyManager
Class
pauseSound
Method in MelodyManager
ClassMethod Signature
Parameters
Parameter
Type
Description
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