PostPlayerSetSelfMuteEvent

The PostPlayerSetSelfMuteEvent is a custom event in the MelodyMine plugin. This event is triggered after a player's self-mute status has been changed. It provides information about the player and the new mute status.

Event Details

AttributeTypeDescription

melodyPlayer

MelodyPlayer

The player whose self-mute status has been changed.

value

boolean

The new self-mute status of the player.

Example Usage

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

import ir.taher7.melodymine.api.events.PostPlayerSetSelfMuteEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class ExampleListener implements Listener {

    @EventHandler
    public void onPlayerSetSelfMute(PostPlayerSetSelfMuteEvent event) {
        // Get the player and the new mute status
        MelodyPlayer player = event.getMelodyPlayer();
        boolean isMuted = event.getValue();

        // Log the information to the console
        Bukkit.getLogger().info(player.getName() + " has changed their self-mute status to: " + isMuted);
    }
}

Remember to register your listener in your plugin's onEnable method to ensure that it is active.

@Override
public void onEnable() {
    getServer().getPluginManager().registerEvents(new ExampleListener(), this);
}

This listener will log a message to the console every time a player changes their self-mute status.

Last updated