> 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/edevents/features/actions.md).

# Actions & Rewards

Rewards, `start-actions`, `end-actions` and `[PERMISSION]` branches are lists of actions written as `[TYPE] arguments`. Placeholders (`{player}`, `{event}`, `{value_formatted}`, `{position}`... see [Placeholders](/p/edevents/features/placeholders.md)) and PlaceholderAPI are replaced first. Actions always run on the main thread.

| Action                                                     | Description                                                                                                                                                                                                                              |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[MESSAGE] <text>`                                         | Sends a chat message to the player.                                                                                                                                                                                                      |
| `[CENTER] <text>`                                          | Sends a centered chat message.                                                                                                                                                                                                           |
| `[BROADCAST] <text>`                                       | Broadcasts to everyone (players who disabled event messages are skipped).                                                                                                                                                                |
| `[BROADCAST-CENTER] <text>`                                | Centered broadcast.                                                                                                                                                                                                                      |
| `[CONSOLE] <command>`                                      | Runs a command as the console (`crate givekey {player} vote 1`).                                                                                                                                                                         |
| `[PLAYER] <command>`                                       | Runs a command as the player.                                                                                                                                                                                                            |
| `[GIVE-ECO] <currency> <amount>`                           | Gives currency through the installed plugin. Amount accepts `1000`, `1,000`, `1.5k`, `2M`, `3B`...                                                                                                                                       |
| `[TAKE-ECO] <currency> <amount>`                           | Takes currency (only if the player can afford it).                                                                                                                                                                                       |
| `[GIVE-ITEM] <MATERIAL> [amount] [name]`                   | Gives an item (drops it if the inventory is full).                                                                                                                                                                                       |
| `[EFFECT] <POTION> [seconds] [level]`                      | Applies a potion effect.                                                                                                                                                                                                                 |
| `[SOUND] <SOUND> [volume] [pitch]`                         | Plays a sound to the player.                                                                                                                                                                                                             |
| `[BROADCAST-SOUND] <SOUND> [volume] [pitch]`               | Plays a sound to everyone.                                                                                                                                                                                                               |
| `[TITLE] <title>\|<subtitle>\|<fadeIn>\|<stay>\|<fadeOut>` | Shows a title to the player (times in ticks, optional).                                                                                                                                                                                  |
| `[BROADCAST-TITLE] <title>\|<subtitle>\|...`               | Title for everyone.                                                                                                                                                                                                                      |
| `[ACTIONBAR] <text>`                                       | One-shot action bar message.                                                                                                                                                                                                             |
| `[BROADCAST-ACTIONBAR] <text>`                             | Action bar message for everyone.                                                                                                                                                                                                         |
| `[FIREWORK] [colors...]`                                   | Launches a firework at the player (`RED GOLD #FF00FF`; random when omitted).                                                                                                                                                             |
| `[LIGHTNING]`                                              | Visual lightning strike at the player (no damage).                                                                                                                                                                                       |
| `[HOST] <action>`                                          | Runs an action written in the **host plugin's own syntax** through its action system — e.g. `[HOST] give-eco tokens 50k` on PinnaPrison, `[HOST] [give-eco] souls 100` on EdDungeons/EdTools, `[HOST] [GIVEECO] tokens 100` on EdPrison. |
| `[PERMISSION] <node> [ACTION] ...`                         | Runs the nested action only if the player has the permission.                                                                                                                                                                            |
| `[DELAY] <seconds>`                                        | Delays every following action of the list by that many seconds (decimals allowed).                                                                                                                                                       |
| `[CHANCE] <percent>`                                       | Runs the next action only with that chance.                                                                                                                                                                                              |

Lower-case and bracket-less forms also work (`message &aHi`, `give-eco tokens 100`).

```yaml
rewards:
  placements:
    1:
      - "[GIVE-ECO] tokens 25k"
      - "[MESSAGE] {prefix}&aYou won &e{event} &awith &f{value_formatted} &a{objective}!"
      - "[FIREWORK] GOLD YELLOW"
      - "[BROADCAST-SOUND] ENTITY_FIREWORK_ROCKET_TWINKLE 1 1"
      - "[DELAY] 2"
      - "[CONSOLE] crate givekey {player} legendary 1"
      - "[CHANCE] 25"
      - "[GIVE-ITEM] NETHER_STAR 1 &d&lLucky Star"
```

## Which currencies can I use?

`[GIVE-ECO]` / `[TAKE-ECO]` accept every currency id of the installed plugin:

| Plugin      | Ids                                                                                                   |
| ----------- | ----------------------------------------------------------------------------------------------------- |
| EdPrison    | Currencies from `config.yml` (`tokens`, `money`, `blocks`...) and level tracks (`rankup`, `pickaxe`). |
| PinnaPrison | Files in `currencies/` (`money`, `tokens`, `gems`, `beacons`, `shards`...).                           |
| EdTools     | Files in `currencies/` (`money`, `farm-coins`, `mine-coins`...).                                      |
| EdDungeons  | Files in `currencies/` (`money`, `souls`, `essence`, `credits`...) plus external ones.                |

Unknown ids are logged to the console and skipped.

## Offline winners

`rewards.offline-rewards` decides what happens when a rewarded player is offline: `queue` (default) stores the actions and runs them when they join (after `rewards.queued-delay-ticks`, with the `rewards.queued-delivered` message), `true` runs them immediately (console commands and currencies work offline on the supported plugins) and `false` skips them. Player-only actions (message, title, sound, item...) are skipped for offline players when running immediately.
