PreAcceptCallEvent
The PreAcceptCallEvent
is a custom event in the Bukkit API. It is triggered when a player accepts a call request in the MelodyMine plugin. This event is called before the call is officially accepted, hence the "Pre" in its name. This gives developers an opportunity to add custom logic or conditions before the call is accepted.
Event Details
melodyPlayer
The MelodyPlayer
instance of the player who is accepting the call.
targetPlayer
The MelodyPlayer
instance of the player who initiated the call.
isCancelled
A boolean value indicating whether the event is cancelled. If true, the call acceptance process will not proceed. This attribute is mutable.
canSendMessage
A boolean value indicating whether a message can be sent to the player. This attribute is mutable.
Example
Here is an example of how to listen to this event using the Bukkit event API in Java:
In this example, we're listening for the PreAcceptCallEvent
, and when it's triggered, we're logging the names of the players involved in the call. We also have the ability to cancel the event or prevent a message from being sent to the player based on certain conditions.
Remember to replace someCondition
and anotherCondition
with your own logic.
Last updated