Class PlayerChatEventImpl
- java.lang.Object
-
- com.velocitypowered.api.event.player.PlayerChatEventImpl
-
- All Implemented Interfaces:
Event,PlayerChatEvent,ResultedEvent<ResultedEvent.GenericResult>
public final class PlayerChatEventImpl extends Object implements PlayerChatEvent
This event is fired when a player types in a chat message.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description PlayerChatEventImpl(Player player, String message)Constructs a PlayerChatEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcurrentMessage()Returns the message currently being sent, which may be modified by plugins.StringoriginalMessage()Returns the message the player originally sent.Playerplayer()Returns the player sending the message.ResultedEvent.GenericResultresult()Returns the result associated with this event.voidsetCurrentMessage(String currentMessage)Sets a new message to send, if the message is allowed to be sent.voidsetResult(ResultedEvent.GenericResult result)Sets the result of this event.StringtoString()
-
-
-
Method Detail
-
player
public Player player()
Description copied from interface:PlayerChatEventReturns the player sending the message.- Specified by:
playerin interfacePlayerChatEvent- Returns:
- the player sending the message
-
originalMessage
public String originalMessage()
Description copied from interface:PlayerChatEventReturns the message the player originally sent.- Specified by:
originalMessagein interfacePlayerChatEvent- Returns:
- the message the player originally sent
-
currentMessage
public String currentMessage()
Description copied from interface:PlayerChatEventReturns the message currently being sent, which may be modified by plugins.- Specified by:
currentMessagein interfacePlayerChatEvent- Returns:
- the message currently being sent
-
setCurrentMessage
public void setCurrentMessage(String currentMessage)
Description copied from interface:PlayerChatEventSets a new message to send, if the message is allowed to be sent.- Specified by:
setCurrentMessagein interfacePlayerChatEvent- Parameters:
currentMessage- the message to send instead of the current (or original) message
-
result
public ResultedEvent.GenericResult result()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
resultin interfaceResultedEvent<ResultedEvent.GenericResult>- Returns:
- the result of this event
-
setResult
public void setResult(ResultedEvent.GenericResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<ResultedEvent.GenericResult>- Parameters:
result- the new result
-
-