Class PlayerChatEvent
java.lang.Object
fr.fidorial.event.player.PlayerChatEvent
- All Implemented Interfaces:
Cancellable, Event, PlayerEvent
- Direct Known Subclasses:
PlayerSignedChatEvent
Fired when a player sends a chat message, before it is broadcast.
Cancelling the event drops the message.
- Since:
- 0.1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the action this event describes will not happen.message()Returns the message about to be broadcast, possibly replaced by a previous listener.player()Returns the player involved in this event.voidsetCancelled(boolean cancelled) Prevents or re-allows the action this event describes.voidsetMessage(Component message) Replaces the message about to be broadcast.
-
Constructor Details
-
PlayerChatEvent
-
-
Method Details
-
player
Description copied from interface:PlayerEventReturns the player involved in this event.- Specified by:
playerin interfacePlayerEvent- Returns:
- the player involved in this event
-
message
Returns the message about to be broadcast, possibly replaced by a previous listener.- Returns:
- the message about to be broadcast, possibly replaced by a previous listener
- Since:
- 0.1.0
-
setMessage
Replaces the message about to be broadcast.- Parameters:
message- the message to broadcast instead- Since:
- 0.1.0
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableReturnstrueif the action this event describes will not happen.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the action this event describes will not happen
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellablePrevents or re-allows the action this event describes.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueto prevent it
-