> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edautofighter/customization/action-types.md).

# Action Types

Actions are written as `[type] args`. Unknown action types are ignored silently so a bad config never breaks a click.

### Autofighter actions

| Action              | Arguments                          | Description                                                         |
| ------------------- | ---------------------------------- | ------------------------------------------------------------------- |
| `[af-spawn]`        | —                                  | Closes the menu and spawns the player's autofighter                 |
| `[af-stop]`         | —                                  | Closes the menu and dismisses the player's autofighter              |
| `[af-upgrade]`      | `speed` / `daily-limit` / `target` | Buys one level of the given upgrade, then reopens the upgrades menu |
| `[af-target-cycle]` | —                                  | Cycles to the next target mode (requires the Target upgrade)        |

### Generic actions

| Action                 | Arguments        | Description                            |
| ---------------------- | ---------------- | -------------------------------------- |
| `[menu]` / `[af-open]` | `<gui id>`       | Opens another GUI template             |
| `[close]`              | —                | Closes the inventory                   |
| `[command]`            | `<command>`      | Runs a command as the player           |
| `[console]`            | `<command>`      | Runs a command from console            |
| `[message]`            | `<text>`         | Sends a coloured message to the player |
| `[sound]`              | `<Bukkit Sound>` | Plays a sound to the player            |

### Example

```yaml
any-click-actions:
  - "[sound] UI_BUTTON_CLICK"
  - "[menu] autofighter-upgrades"
```
