Class ClientChatEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ClientChatEvent
- All Implemented Interfaces:
- net.neoforged.bus.api.ICancellableEvent
public class ClientChatEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
Fired when the client is about to send a chat message to the server.
 
This event is cancellable, and does not 
.
 If the event is cancelled, the chat message will not be sent to the server.invalid reference
have a result
This event is fired on the main Forge event bus, only on the logical client.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the message that will be sent to the server, if the event is not cancelled. This can be changed by mods.Returns the original message that was to be sent to the server. This cannot be changed by mods.voidsetMessage(String message) Sets the new message to be sent to the server, if the event is not cancelled.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEventisCanceled, setCanceled
- 
Field Details- 
message
- 
originalMessage
 
- 
- 
Constructor Details- 
ClientChatEvent
 
- 
- 
Method Details- 
getMessageReturns the message that will be sent to the server, if the event is not cancelled. This can be changed by mods.- Returns:
- the message that will be sent to the server, if the event is not cancelled. This can be changed by mods
 
- 
setMessageSets the new message to be sent to the server, if the event is not cancelled.- Parameters:
- message- the new message to be sent
 
- 
getOriginalMessageReturns the original message that was to be sent to the server. This cannot be changed by mods.- Returns:
- the original message that was to be sent to the server. This cannot be changed by mods
 
 
-