Adding custom actions to Custom Main Menu
The general idea is to make a class with your function that implements CMM's IAction interface, getting the list of buttons in the main menu, and setting an instance of this IAction as the target button's action. I identify the target button with its displayname.
@Optional.Interface(iface = "lumien.custommainmenu.lib.actions.IAction", modid = "CustomMainMenu", striprefs = true)
public class ActionOpenSomeGui implements lumien.custommainmenu.lib.actions.IAction {