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) Deprecated.for 1.19.1 and newer, set this as denied will kick userstoString()
-
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
Deprecated.for 1.19.1 and newer, set this as denied will kick usersSet result for the event.- Specified by:
setResult
in interfaceResultedEvent<PlayerChatEvent.ChatResult>
- Parameters:
result
- the result of event
-
toString
-