Interface ClientReceiveMessageEvents.AllowGame
- Enclosing class:
ClientReceiveMessageEvents
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanallowReceiveGameMessage(net.minecraft.network.chat.Component message, boolean overlay) Called when the client receives a game message, which is any message sent by the server.
-
Method Details
-
allowReceiveGameMessage
boolean allowReceiveGameMessage(net.minecraft.network.chat.Component message, boolean overlay) Called when the client receives a game message, which is any message sent by the server. Returningfalseprevents the message from being displayed, andClientReceiveMessageEvents.GAME_CANCELEDwill be triggered instead ofClientReceiveMessageEvents.MODIFY_GAME.Overlay is whether the message will be displayed in the action bar. To toggle overlay, return false and call either
LocalPlayer.sendSystemMessage(message)orLocalPlayer.sendOverlayMessage(message).- Parameters:
message- the message received from the serveroverlay- whether the message will be displayed in the action bar- Returns:
trueif the message should be displayed, otherwisefalse
-