Skip to content

Instantly share code, notes, and snippets.

View trollogyadherent's full-sized avatar

mzt hjg87v8t trollogyadherent

View GitHub Profile
@trollogyadherent
trollogyadherent / hook-into-custommainmenu.md
Created August 13, 2022 19:05
How to add own Custom Main Menu button actions (1.7.10)

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.

Example action:

@Optional.Interface(iface = "lumien.custommainmenu.lib.actions.IAction", modid = "CustomMainMenu", striprefs = true)
public class ActionOpenSomeGui implements lumien.custommainmenu.lib.actions.IAction {