LabyMod events

Using LabyMod events

There are some LabyMod events that Forge has not implemented before. You can register listeners for those events by using LabyModAddon#getApi()#getEventManager()#register/registerOnJoin/registerOnQuit/registerOnAttack(). These are the events you can use:

  • EventManager#register( TabListEvent listener ) - the TabListEvent will be called when the tablist header or footer updates

  • EventManager#register( MessageModifyChatEvent listener ) - the MessageModifyChatEvent can be used to modify incoming chat messages

  • EventManager#register( MessageReceiveEvent listener ) - the MessageReceiveEvent can be used to handle incoming chat messages. If you return true, the message won't show up in the chat.

  • EventManager#register( MessageSendEvent listener ) - the MessageSendEvent will be called when the player tries to send a message to the server. If you return true, the message won't be sent to the server.

  • EventManager#register( PluginMessageEvent listener ) - the PluginMessageEvent can be used to handle incoming plugin messages

  • EventManager#register( RenderEntityEvent listener ) - the RenderEntityEvent will be called after an entity has been rendered

  • EventManager#registerOnJoin( Consumer<ServerData> listener ) - the callback will be called when the client has joined a new server

  • EventManager#registerOnQuit( Consumer<ServerData> listener ) - the callback will be called when the client has quit a server

  • EventManager#registerOnAttack( Consumer<Entity> listener ) - the callback will be called when the player attacks an entity