> For the complete documentation index, see [llms.txt](https://realisticnode.gitbook.io/rnsetups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://realisticnode.gitbook.io/rnsetups/rnpsmenu/reference/api.md).

# Developer API

Events and commands for other plugins.

## PsMenuActionEvent

`com.realisticnode.rnpsmenu.api.PsMenuActionEvent` is called just before rnPsMenu changes a region for a player, after every check has passed. Cancel it to stop the change.

```java
@EventHandler
public void onAction(PsMenuActionEvent e) {
    if (e.getAction().equals("unclaim") && isInWar(e.getPlayer())) {
        e.setCancelled(true);
    }
}
```

* `getPlayer()`, `getRegion()` (a ProtectionStones `PSRegion`), `getAction()`, `getDetail()`.
* Actions: `rename`, `sethome`, `priority`, `add-member`, `add-owner`, `remove-member`, `remove-owner`, `demote`, `leave`, `ban`, `unban`, `expel`, `flag`, `preset`, `copy-flags`, `hide`, `unhide`, `unclaim`, `sell`, `buy`, `lease`, `stop-lease`, `rent`, `stop-renting`, `tax-pay`, `merge`.

## Opening menus

From the console or another plugin: `/psmenu open <menu> <player> [region]`.
