Class PlayerChatEvent
- java.lang.Object
-
- com.velocitypowered.api.event.player.PlayerChatEvent
-
- All Implemented Interfaces:
ResultedEvent<PlayerChatEvent.ChatResult>
@AwaitingEvent public final class PlayerChatEvent extends Object implements ResultedEvent<PlayerChatEvent.ChatResult>
This event is fired when a player types in a chat message. Velocity will wait on this event to finish firing before forwarding it to the server, if the result allows it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPlayerChatEvent.ChatResultRepresents the result of thePlayerChatEvent.-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description PlayerChatEvent(Player player, String message)Constructs a PlayerChatEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMessage()PlayergetPlayer()PlayerChatEvent.ChatResultgetResult()Returns the result associated with this event.voidsetResult(PlayerChatEvent.ChatResult result)Sets the result of this event.StringtoString()
-
-
-
Method Detail
-
getPlayer
public Player getPlayer()
-
getMessage
public String getMessage()
-
getResult
public PlayerChatEvent.ChatResult getResult()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<PlayerChatEvent.ChatResult>- Returns:
- the result of this event
-
setResult
public void setResult(PlayerChatEvent.ChatResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<PlayerChatEvent.ChatResult>- Parameters:
result- the new result
-
-