Skip to main content

Menu Entries

com.n3plugins.sdk.menu exposes the client's current menu entries as immutable snapshots for diagnostics and failed-action inspection. Action matching and one-based action-index resolution remain documented on Action Resolver.

Caution

Do not dispatch actions directly from MenuEntrySnapshot values. Use InteractionApi.actions.* and ActionResolver for action execution and keep this page's APIs for inspection.

List<MenuEntrySnapshot> entries = MenuEntriesApi.entries();
Optional<MenuEntrySnapshot> bank = MenuEntriesApi.firstMatching("Bank", "Banker");
boolean hasTakeCoins = MenuEntriesApi.contains("Take", "Coins");
log.debug("Current menu entries: {}", MenuEntriesApi.diagnostics());

Methods:

  • entries() - captures current client.getMenuEntries() values as an immutable list of MenuEntrySnapshots. Null client or null menu entries return an empty list.
  • firstMatching(option, target) - returns the first entry whose normalized option and target match case-insensitively. Pass null for either argument to ignore that side.
  • contains(option, target) - true when firstMatching(...) finds a match.
  • diagnostics() - formats current entries as option -> target pairs joined by semicolons for logs and failure messages.

MenuEntrySnapshot normalizes text by removing RuneLite tags and trimming whitespace at capture time. It stores:

  • getOption()
  • getTarget()
  • getIdentifier()
  • getType()
  • getParam0()
  • getParam1()
  • getItemId()
  • getWorldViewId()
  • isDeprioritized()
  • matches(option, target)

Snapshots are useful when an InteractionResult reports ACTION_NOT_FOUND and you need to see what the client actually offered on the menu. They are not a replacement for the result-aware action classes.