public void register(Object target) {
        for (Method method : target.getClass().getMethods()) {
            // Ignore static methods, Support for these could be added, but they are not used in LuckPerms
            if (Modifier.isStatic(method.getModifiers())) {
                continue;
            }

            // Methods require a SubscribeEvent annotation in order to be registered
            SubscribeEvent subscribeEvent = method.getAnnotation(SubscribeEvent.class);
            if (subscribeEvent == null) {
                continue;
            }

            EventType type = determineListenerType(method);
            Consumer<?> invoker = createInvokerFunction(method, target, type);

            // Determine the 'IEventBus' that this eventType should be registered to.
            IEventBus eventBus;
            if (IModBusEvent.class.isAssignableFrom(type.eventType)) {
                eventBus = FMLJavaModLoadingContext.get().getModEventBus();
            } else {
                eventBus = MinecraftForge.EVENT_BUS;
            }

            if (IGenericEvent.class.isAssignableFrom(type.eventType)) {
                addGenericListener(eventBus, type.genericType, subscribeEvent, type.eventType, invoker);
            } else {
                addListener(eventBus, subscribeEvent, type.eventType, invoker);
            }

            this.listeners.add(new ListenerRegistration(invoker, eventBus, target));
        }
    }
Register listeners for all methods annotated with {@link SubscribeEvent} on the target object.
forge/src/main/java/me/lucko/luckperms/forge/util/ForgeEventBusFacade.java