Package net.minecraftforge.event
Class ServerChatEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.ServerChatEvent
public class ServerChatEvent
extends net.minecraftforge.eventbus.api.Event
This event is fired whenever a 
ServerboundChatPacket is received from a client
 who has submitted their chat message.
 This event is cancellable, and does not have a result. If the event is cancelled, the message will not be sent to clients.
This event is fired on the main Forge event bus, only on the logical server.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the message that will be sent to the relevant clients, if the event is not cancelled.Returns the player who initiated the chat action.Returns the original raw text of the player chat message.Returns the username of the player who initiated the chat action.voidsetMessage(Component message) Set the message to be sent to the relevant clients.Methods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
player
- 
username
- 
rawText
- 
message
 
- 
- 
Constructor Details- 
ServerChatEvent
 
- 
- 
Method Details- 
getPlayerReturns the player who initiated the chat action.- Returns:
- the player who initiated the chat action
 
- 
getUsernameReturns the username of the player who initiated the chat action.- Returns:
- the username of the player who initiated the chat action
 
- 
getRawTextReturns the original raw text of the player chat message.- Returns:
- the original raw text of the player chat message
 
- 
setMessageSet the message to be sent to the relevant clients.
- 
getMessageReturns the message that will be sent to the relevant clients, if the event is not cancelled.- Returns:
- the message that will be sent to the relevant clients, if the event is not cancelled
 
 
-