Skip to main content

Migration From Legacy APIs

Legacy boolean and void helpers remain available. Prefer result-aware APIs for new automation - they report failure causes through InteractionResult.

Runtime migration note: n3 plugins are now native RuneLite plugin entries. PacketUtilsPlugin is the only required shared enabled plugin. The reusable SDK code lives under com.n3plugins.sdk.*.

  • Spell widget clicks: MagicActions.cast(Spell)
  • Direct prayer toggles: PrayerActions.enable/disable/set
  • Ad hoc movement path state: NavigationActions
  • Bank wrapper additions: BankActions.count, withdrawAll, depositAll, withdrawNoted(String, int)

Old style:

boolean clicked = InventoryInteraction.useItem("Bones", "Bury");
if (!clicked) {
return;
}

New style:

InteractionResult result = InventoryActions.use("Bones", "Bury");
if (result.failed()) {
log.debug("Inventory action failed: {}", result.getMessage());
return;
}

Migration rules:

  • Keep old helpers for existing plugins unless you are already touching the call site.
  • Prefer result-aware methods in new workflow code.
  • Prefer com.n3plugins.sdk.* helpers for shared client, widget, query, walker, loadout, and workflow utilities.
  • Do not change BankInteraction.withdrawX(..., boolean) default amount behavior until live behavior is verified.
  • Keep public APIs Java 11 compatible.

Legacy Compatibility Facades

The following public classes remain available for source compatibility. They generally return boolean or void and do not expose the richer InteractionResult status model. New automation should prefer the matching InteractionApi.actions.* class unless the caller already depends on the older return shape.

Legacy facadePrefer for new code
InventoryInteractionInventoryActions
BankInventoryInteractionBankInventoryActions
BankInteractionBankActions
GeInventoryInteractionGrandExchangeActions or AutomationApi.grandExchange
ShopInventoryInteractionShopActions or AutomationApi.shops
NPCInteractionNPCActions
TileObjectInteractionObjectActions
PlayerInteractionHelperPlayerActions
InteractionHelper prayer helpersPrayerActions

The compatibility facades are intentionally thin. Keep behavior-preserving migrations small: replace one helper call with its result-aware equivalent, then handle result.failed() at the owning decision point.