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
Modifier and TypeClassDescriptionstatic final class
Represents the result of thePlayerChatEvent
.Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
Constructor Summary
ConstructorDescriptionPlayerChatEvent
(Player player, String message) Constructs a PlayerChatEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the result associated with this event.void
setResult
(PlayerChatEvent.ChatResult result) Sets the result of this event.toString()
-
Constructor Details
-
PlayerChatEvent
Constructs a PlayerChatEvent.- Parameters:
player
- the player sending the messagemessage
- the message being sent
-
-
Method Details
-
getPlayer
-
getMessage
-
getResult
Description copied from interface:ResultedEvent
Returns the result associated with this event.- Specified by:
getResult
in interfaceResultedEvent<PlayerChatEvent.ChatResult>
- Returns:
- the result of this event
-
setResult
Description copied from interface:ResultedEvent
Sets the result of this event. The result must be non-null.- Specified by:
setResult
in interfaceResultedEvent<PlayerChatEvent.ChatResult>
- Parameters:
result
- the new result
-
toString
-