enableVoice()

enableVoice Method in MelodyManager Class

The enableVoice method is a part of the MelodyManager class. This method is used to enable the voice feature for a player in the MelodyMine plugin.

Method Signature

public void enableVoice(String playerName, String playerUuid, String playerServer, String targetSocketID)

Parameters

ParameterTypeDescription

playerName

String

The name of the player for whom the voice feature is to be enabled.

playerUuid

String

The unique identifier (UUID) of the player.

playerServer

String

The server on which the player is currently playing.

targetSocketID

String

The socket ID of the target player.

Example Usage

Below is an example of how to use the enableVoice method in another plugin.

import ir.taher7.melodymine.core.MelodyManager;

public class ExamplePlugin {
    public void enableVoiceForPlayer() {
        // Assuming these values are obtained dynamically
        String playerName = "examplePlayer";
        String playerUuid = "exampleUuid";
        String playerServer = "exampleServer";
        String targetSocketID = "exampleSocketID";

        // Enable voice for the player
        MelodyManager.INSTANCE.enableVoice(playerName, playerUuid, playerServer, targetSocketID);

        // Log to console
        Bukkit.getLogger().info("Voice enabled for player: " + playerName + " to socketID: " + targetSocketID);
    }
}

Make sure to replace the example values with actual values when using this method.

Last updated