PreAcceptCallEvent
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