Package net.minecraftforge.event
Class ServerChatEvent.Preview
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.ServerChatEvent
net.minecraftforge.event.ServerChatEvent.Preview
- Enclosing class:
- ServerChatEvent
This event is fired whenever a
ServerboundChatPreviewPacket
is received from a client typing a message.
This event is cancellable, and does not have a result. If the event is cancelled, the chat preview sent back to the client will match the original message.
This event is fired on the main Forge event bus, only on the logical server.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.ServerChatEvent
ServerChatEvent.Preview, ServerChatEvent.Submitted
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the chat preview that will be sent back to the client, if the event is not cancelled.void
setMessage
(Component message) Set the chat preview to be sent back to the client.Methods inherited from class net.minecraftforge.event.ServerChatEvent
canChangeMessage, getPlayer, getRawText, getUsername
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Constructor Details
-
Preview
-
-
Method Details
-
setMessage
Set the chat preview to be sent back to the client.- Overrides:
setMessage
in classServerChatEvent
- See Also:
-
getMessage
Returns the chat preview that will be sent back to the client, if the event is not cancelled.- Overrides:
getMessage
in classServerChatEvent
- Returns:
- the chat preview that will be sent back to the client, if the event is not cancelled
-