PlayerJoinWebEvent
The PlayerJoinWebEvent
is a custom event in the MelodyMine plugin. This event is triggered when a player joins the web client of the MelodyMine voice chat system. The event contains a single property, melodyPlayer
, which is an instance of the MelodyPlayer
class representing the player who has joined the web client.
Properties
melodyPlayer
MelodyPlayer
The player who has joined the web client.
Example
Here is an example of how to listen to the PlayerJoinWebEvent
using the Bukkit event API in Java:
In this example, we create a class ExampleListener
that implements the Listener
interface. Inside this class, we define a method onPlayerJoinWeb
with the @EventHandler
annotation to specify that this method should be called when the PlayerJoinWebEvent
is triggered. In the method body, we retrieve the name of the player who has joined the web client and log a message to the console.
Remember to register the event listener in your plugin's onEnable
method:
This will ensure that your onPlayerJoinWeb
method is called whenever a PlayerJoinWebEvent
is triggered.
Last updated