LogoLogo
  • Introduction
  • Documentation License
  • Modding Basics
  • Getting Started
  • Configuration
    • Creating a Config
    • Config Options
      • Boolean Configs
      • Number Configs
      • Selector Configs
      • Text Configs
      • Buttons, Colors and Keybinds
      • Decorative Components
      • Custom options
    • Migration
  • Events
    • Event Basics
    • Available Events
      • ChatReceiveEvent
      • TickEvent
      • InitializationEvent
      • HudRenderEvent
      • Packet Events
      • LocrawEvent
  • Graphics & UI
    • Render Manager
      • Font Rendering
    • Elements
    • Pages
  • Commands
    • Commands
    • An Example Command
  • HUDs
    • HUD Basics
  • Utilities
    • OneConfig's Utilities
      • Notifications
      • HypixelUtils
    • OneColor
    • OneUIScreen
Powered by GitBook
On this page

Was this helpful?

  1. Events
  2. Available Events

ChatReceiveEvent

Learn more about ChatReceiveEvent

ChatReceiveEvent is an event that is fired when the client receives a chat message.

This event is Cancellable, meaning you can stop other mods and the game itself from receiving messages. Be careful!

You can use event.message to get the message that was received as a IChatComponent. If you want it as plain text, don't worry! You can use .getUnformattedText() to get the message as a plain String.

@Subscribe
public void onChatReceive(ChatReceiveEvent event) {
    System.out.println("I just received a message! " + event.message.getUnformattedText());
}
PreviousAvailable EventsNextTickEvent

Last updated 2 years ago

Was this helpful?