--- title: "Actions API - Sorted wiki" description: "Run Sorted's actions by id, for a shortcut wheel, a radial menu or buttons of your own." url: https://voxelsprout.com/sorted/wiki/actions-api --- [Sorted](https://voxelsprout.com/sorted) [Wiki](https://voxelsprout.com/sorted/wiki)Actions API # Actions API Run Sorted's actions by id, for a shortcut wheel, a radial menu or buttons of your own. `SortedActions` lists what Sorted can do, by id, with a name in the player's language, and runs it. Sort the inventory, Quick Stack to nearby containers, open the search. From Sorted **0.1.31**. ```java if (SortedActions.isAvailable()) { for (String id : SortedActions.ids()) { String name = SortedActions.label(id); // in the player's language Boolean on = SortedActions.isOn(id); // true/false for a switch, null otherwise } SortedActions.run("sorted:quick_stack_nearby"); } ``` `run` does it once, and returns false when the id is unknown, the server does not allow it, or there is nothing to do. `isOn` is cheap, fine every frame. ## The actions | Id | What it does | | ----------------------------- | --------------------------------------------------------- | | sorted:search | Opens the item search. | | sorted:keep\_list | Opens the keep list. | | sorted:sort\_inventory | Sorts the inventory, with or without a screen open. | | sorted:quick\_stack\_nearby | Puts items into nearby containers that already hold them. | | sorted:smart\_empty\_nearby | Puts everything into the best-fitting nearby containers. | | sorted:quick\_fill\_nearby | Tops up the inventory's stacks from nearby containers. | | sorted:clear\_highlight | Takes away the search highlight. | | sorted:auto\_sort\_inventory | A switch: sorting the inventory on its own. | | sorted:auto\_sort\_containers | A switch: sorting chests as they open. | | sorted:settings | Opens Sorted's settings. | ## Reference | SortedActions | What it does | | ------------------- | ------------------------------------------------------------------------------ | | isAvailable() | Sorted is running, in a world, and not off on this server. | | ids() | Every action id, in menu order. | | labelKey(String id) | The translation key of its name, or null for an unknown id. | | label(String id) | Its name in the player's language, or null for an unknown id. | | isOn(String id) | True or false for a switch, null for anything else. | | run(String id) | Runs it once. False when unknown, not allowed by the server, or nothing to do. | [Previous Lookup API](https://voxelsprout.com/sorted/wiki/lookup-api) [Next Protection API](https://voxelsprout.com/sorted/wiki/protection-api) Something missing or wrong on this page? Say so on [Discord](https://discord.gg/CvdkGbEW4y).