disableVoice()
disableVoice
Method in MelodyManager
Class
disableVoice
Method in MelodyManager
ClassMethod Signature
public void disableVoice(String playerName, String playerUuid, String playerServer, String targetSocketID)
Parameters
Parameter
Type
Description
playerName
String
The name of the player for whom the voice functionality is to be disabled.
playerUuid
String
The UUID of the player for whom the voice functionality is to be disabled.
playerServer
String
The server on which the player is currently playing.
targetSocketID
String
The ID of the socket that is to be targeted for the operation.
Example Usage
Here is an example of how you might use the disableVoice
method in another plugin:
import ir.taher7.melodymine.core.MelodyManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class ExamplePlugin {
public void disablePlayerVoice(Player player) {
String playerName = player.getName();
String playerUuid = player.getUniqueId().toString();
String playerServer = Bukkit.getServer().getName();
String targetSocketID = "exampleSocketID"; // Replace with actual socket ID
MelodyManager.INSTANCE.disableVoice(playerName, playerUuid, playerServer, targetSocketID);
Bukkit.getLogger().info("Voice functionality has been disabled for player: " + playerName + " to SocketID:" + targetSocketID);
}
}
In this example, we're disabling the voice functionality for a specific player and then logging this action to the console.
Last updated