Contents
Class PlayerChatEvent
java.lang.Object
com.hypixel.hytale.server.core.event.events.player.PlayerChatEvent
- All Implemented Interfaces:
IAsyncEvent<String>, IBaseEvent<String>, ICancellable
A player event called when a player sends a chat message.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA functional interface used to format player chat messages. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PlayerChatEvent.FormatterThe default message formatter for player messages. -
Constructor Summary
ConstructorsConstructorDescriptionPlayerChatEvent(PlayerRef sender, List<PlayerRef> targets, String content) Default Constructor for aPlayerChatEventinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this event has been cancelled.voidsetCancelled(boolean cancelled) Called to set whether this event is cancelled.voidsetContent(String content) Called to set the message that is to be sent.voidsetFormatter(PlayerChatEvent.Formatter formatter) Called to set the formatter to be applied to the players message.voidCalled to set the player that sent the message.voidsetTargets(List<PlayerRef> targets) Called to set the list of target players that will receive the message.toString()
-
Field Details
-
DEFAULT_FORMATTER
The default message formatter for player messages.
-
-
Constructor Details
-
PlayerChatEvent
public PlayerChatEvent(@Nonnull PlayerRef sender, @Nonnull List<PlayerRef> targets, @Nonnull String content) Default Constructor for aPlayerChatEventinstance.- Parameters:
targets- The list of players to receive the chat message.content- The content of the chat message from the player.
-
-
Method Details
-
getSender
- Returns:
- the player that sent the message.
-
setSender
Called to set the player that sent the message.- Parameters:
sender- The player that sent the message.
-
getTargets
-
setTargets
-
getContent
-
setContent
-
getFormatter
- Returns:
- the formatter to be applied to the players message.
-
setFormatter
Called to set the formatter to be applied to the players message.- Parameters:
formatter- The formatter to be set.
-
isCancelled
public boolean isCancelled()Description copied from interface:ICancellableDetermines whether this event has been cancelled.- Specified by:
isCancelledin interfaceICancellable- Returns:
trueif the event has been cancelled,falseotherwise.
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:ICancellableCalled to set whether this event is cancelled.- Specified by:
setCancelledin interfaceICancellable- Parameters:
cancelled-trueto cancel the event,falseto uncancel it.
-
toString
-