Skip to content

LabyMod events

Warning

This page is for the LabyMod 3 Addon API, which is no longer maintained nor supported. Visit https://wiki.labymod.net/pages/addon/ for the LabyMod 4 Addon API Wiki.

Using LabyMod events in 1.16.5:

import net.labymod.api.event.Subscribe;
import net.labymod.api.event.events.client.TickEvent;

@Subscribe
public void onTick(TickEvent event) {
    // Handle tick
}

All events

  • MessageModifyEvent
  • MessageReceiveEvent
  • MessageSendEvent
  • RenderGameOverlayEvent
  • DrawScreenEvent
  • PlayerTabListOverlayEvent
  • ScreenOpenEvent
  • MouseInputEvent
  • AttackEntityEvent
  • FOVUpdateEvent
  • RenderEntityEvent
  • RenderNameTagEvent
  • RenderWorldLastEvent
  • RenderTickEvent
  • ShutdownEvent
  • TickEvent
  • UserActionMenuEvent
  • PacketAddonDevelopmentEvent
  • PacketAddonMessageEvent
  • IncomingPacketEvent
  • PayloadMessageEvent
  • DisconnectServerEvent
  • LoginServerEvent
  • PostLoginServerEvent
  • ServerEvent
  • ServerSwitchEvent
  • ServerMessageEvent

Using LabyMod events in 1.8.9 and 1.12.2

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

  • EventManager#registerAddonMessage( PacketAddonMessage listener ) - the callback will be called when LabyConnect sends messages to the client

  • EventManager#registerOnIncomingPacket( Consumer<Object> listener ) - the callback will be called when the Minecraft server sends you a packet

  • EventManager#registerOnAddonDevelopmentPacket( Consumer<PacketAddonDevelopment> listener ) - the callback will be called when another LabyMod addon sends you a message

  • EventManager#register( UserMenuActionEvent listener ) - the callback will be called when the user performs an action in the player menu

  • EventManager#register( MouseInputEvent listener ) - the callback will be called when the user interacts with the mouse on the screen

  • EventManager#register( RenderIngameOverlayEvent listener ) - the callback will be called after rendering the GUI overlay