Class PlayerChatEvent.ChatResult
- java.lang.Object
-
- com.velocitypowered.api.event.player.PlayerChatEvent.ChatResult
-
- All Implemented Interfaces:
ResultedEvent.Result
- Enclosing class:
- PlayerChatEvent
public static final class PlayerChatEvent.ChatResult extends Object implements ResultedEvent.Result
Represents the result of thePlayerChatEvent.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PlayerChatEvent.ChatResultallowed()Allows the message to be sent, without modification.static PlayerChatEvent.ChatResultdenied()Prevents the message from being sent.Optional<String>getMessage()booleanisAllowed()Returns whether or not the event is allowed to proceed.static PlayerChatEvent.ChatResultmessage(@NonNull String message)Allows the message to be sent, but silently replaces it with another.StringtoString()
-
-
-
Method Detail
-
isAllowed
public boolean isAllowed()
Description copied from interface:ResultedEvent.ResultReturns whether or not the event is allowed to proceed. Plugins may choose to skip denied events, and the proxy will respect the result of this method.- Specified by:
isAllowedin interfaceResultedEvent.Result- Returns:
- whether or not the event is allowed to proceed
-
allowed
public static PlayerChatEvent.ChatResult allowed()
Allows the message to be sent, without modification.- Returns:
- the allowed result
-
denied
public static PlayerChatEvent.ChatResult denied()
Prevents the message from being sent.- Returns:
- the denied result
-
message
public static PlayerChatEvent.ChatResult message(@NonNull String message)
Allows the message to be sent, but silently replaces it with another.- Parameters:
message- the message to use instead- Returns:
- a result with a new message
-
-