unMute()

unMute Method in MelodyManager Class

The unMute method is a part of the MelodyManager class in the MelodyMine plugin. This method is used to unmute a player in the voice chat.

Method Signature

public void unMute(UUID uuid)

Parameters

ParameterTypeDescription

uuid

UUID

The UUID of the player to be unmuted.

Usage

To use the unMute method, you need to have the UUID of the player you want to unmute. Here is an example of how to use this method in another plugin:

import ir.taher7.melodymine.core.MelodyManager;
import org.bukkit.Bukkit;
import java.util.UUID;

public class ExamplePlugin {
    public void unmutePlayer(String playerName) {
        UUID playerUUID = Bukkit.getPlayer(playerName).getUniqueId();
        MelodyManager.INSTANCE.unMute(playerUUID);
        Bukkit.getLogger().info("Player " + playerName + " has been unmuted.");
    }
}

Make sure the player is currently muted before calling the unMute method. If the player is not muted, calling this method will have no effect.

In the above example, we first get the UUID of the player using Bukkit's getPlayer method. Then, we call the unMute method on the MelodyManager instance, passing in the player's UUID. Finally, we log a message to the console indicating that the player has been unmuted.

Last updated