PreSetVolumeEvent
The PreSetVolumeEvent
is a custom event in the MelodyMine plugin. This event is triggered before the volume of a player is set. It provides the ability to get the player and target player involved in the volume setting process.
Event Details
getPlayer()
Returns the MelodyPlayer
instance of the player whose volume is being set.
getTargetPlayer()
Returns the MelodyPlayer
instance of the target player involved in the volume setting process.
Event Usage
This event can be used to perform actions or checks before the volume of a player is set. For example, you can use it to log the volume setting process or prevent it under certain conditions.
Example
Here is an example of how to listen to this event using the Bukkit event API:
In this example, we create a listener for the PreSetVolumeEvent
. When the event is triggered, we retrieve the player and target player involved in the volume setting process and log their names to the console.
Last updated