Class ClientReceiveMessageEvents
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Event
<ClientReceiveMessageEvents.AllowChat> An event triggered when the client receives a chat message, which is any message sent by a player.static final Event
<ClientReceiveMessageEvents.AllowGame> An event triggered when the client receives a game message, which is any message sent by the server.static final Event
<ClientReceiveMessageEvents.Chat> An event triggered when the client receives a chat message, which is any message sent by a player.static final Event
<ClientReceiveMessageEvents.ChatCanceled> An event triggered when receiving a chat message is canceled withALLOW_CHAT
.static final Event
<ClientReceiveMessageEvents.Game> An event triggered when the client receives a game message, which is any message sent by the server.static final Event
<ClientReceiveMessageEvents.GameCanceled> An event triggered when receiving a game message is canceled withALLOW_GAME
.static final Event
<ClientReceiveMessageEvents.ModifyGame> An event triggered when the client receives a game message, which is any message sent by the server. -
Method Summary
-
Field Details
-
ALLOW_CHAT
An event triggered when the client receives a chat message, which is any message sent by a player. Mods can use this to block the message.If a listener returned
false
, the message will not be displayed, the remaining listeners will not be called (if any), andCHAT_CANCELED
will be triggered instead ofCHAT
. -
ALLOW_GAME
An event triggered when the client receives a game message, which is any message sent by the server. Mods can use this to block the message or toggle overlay.If a listener returned
false
, the message will not be displayed, the remaining listeners will not be called (if any), andGAME_CANCELED
will be triggered instead ofMODIFY_GAME
.Overlay is whether the message will be displayed in the action bar. To toggle overlay, return false and call
ClientPlayerEntity.sendMessage(message, overlay)
. -
MODIFY_GAME
An event triggered when the client receives a game message, which is any message sent by the server. Is not called when game messages are blocked. Mods can use this to modify the message. UseGAME
if not modifying the message.Overlay is whether the message will be displayed in the action bar. Use
to toggle overlay
. -
CHAT
An event triggered when the client receives a chat message, which is any message sent by a player. Is not called when chat messages are blocked. Mods can use this to listen to the message.If mods want to modify the message, they should use
ALLOW_CHAT
and manually add the new message to the chat hud usingChatHud.addMessage(Text)
-
GAME
An event triggered when the client receives a game message, which is any message sent by the server. Is not called when game messages are blocked. Mods can use this to listen to the message.Overlay is whether the message will be displayed in the action bar. Use
to toggle overlay
. -
CHAT_CANCELED
An event triggered when receiving a chat message is canceled withALLOW_CHAT
. -
GAME_CANCELED
An event triggered when receiving a game message is canceled withALLOW_GAME
.Overlay is whether the message would have been displayed in the action bar.
-