PostUnMutePlayerEvent

The PostUnMutePlayerEvent is a custom event in the MelodyMine plugin. This event is triggered after a player has been server unmuted. It provides access to the MelodyPlayer instance of the player who was unmuted.

Class Structure

Method/Variable
Type
Description

melodyPlayer

MelodyPlayer

The player who has been unmuted.

Example Usage

Here is an example of how to listen to this event using the Bukkit event API in Java:

import ir.taher7.melodymine.api.events.PostUnMutePlayerEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public class ExampleListener implements Listener {

    private JavaPlugin plugin;

    public ExampleListener(JavaPlugin plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onPostUnMutePlayer(PostUnMutePlayerEvent event) {
        // Get the MelodyPlayer who was unmuted
        MelodyPlayer player = event.getMelodyPlayer();

        // Log to console
        plugin.getLogger().info(player.getName() + " has been unmuted.");
    }
}

Remember to register your listener in your plugin's onEnable method like so:

getServer().getPluginManager().registerEvents(new ExampleListener(this), this);

Last updated