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.

@FunctionalInterface public static interface ClientReceiveMessageEvents.AllowGame
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    allowReceiveGameMessage(Text message, boolean overlay)
    Called when the client receives a game message, which is any message sent by the server.
  • Method Details

    • allowReceiveGameMessage

      boolean allowReceiveGameMessage(Text message, boolean overlay)
      Called when the client receives a game message, which is any message sent by the server. Returning false prevents the message from being displayed, and ClientReceiveMessageEvents.GAME_CANCELED will be triggered instead of ClientReceiveMessageEvents.MODIFY_GAME.

      Overlay is whether the message will be displayed in the action bar. To toggle overlay, return false and call ClientPlayerEntity.sendMessage(message, overlay).

      Parameters:
      message - the message received from the server
      overlay - whether the message will be displayed in the action bar
      Returns:
      true if the message should be displayed, otherwise false