> For the complete documentation index, see [llms.txt](https://ultimaterewards.athelion.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ultimaterewards.athelion.eu/configuration/rewards/reward-actions.md).

# Reward Actions

Action types of rewards

Each reward has its own set of actions that are executed upon claiming the reward.

The following pattern is valid for use: `[<action>] <statement>`

## Available actions

| Action        | What it does                                                                                   |
| ------------- | ---------------------------------------------------------------------------------------------- |
| `[CONSOLE]`   | The statement is executed as a command from the console                                        |
| `[PLAYER]`    | The statement is executed as a command by the player                                           |
| `[MESSAGE]`   | Sends the text to the claiming player                                                          |
| `[BROADCAST]` | Sends the text to all online players                                                           |
| `[ANNOUNCE]`  | Same as `[BROADCAST]`                                                                          |
| `[TITLE]`     | Sends the primary title                                                                        |
| `[SUBTITLE]`  | Sends the secondary title                                                                      |
| `[ACTIONBAR]` | Shows the text in the action bar (<mark style="color:yellow;">1.12+ only</mark>)               |
| `[BOSSBAR]`   | Shows the text in a boss bar for a few seconds (<mark style="color:yellow;">1.12+ only</mark>) |
| `[SOUND]`     | Plays a sound for the player                                                                   |
| `[FIREWORK]`  | Launches a firework above the player                                                           |
| `[OPEN]`      | Opens the specified [menu](/configuration/menus/basics.md) for the player                      |

{% hint style="info" %}
`[TITLE]` and `[SUBTITLE]` are combined into a single title, so you can use both in one reward without them overwriting each other.
{% endhint %}

## Placeholders in actions

| Placeholder | Replaced by                                  |
| ----------- | -------------------------------------------- |
| `%player%`  | Name of the claiming player                  |
| `%type%`    | Identifier (file name) of the claimed reward |
| `%tag%`     | The reward's `tag` from its .yml file        |

On top of that you can use [random placeholders](/configuration/rewards/reward-features/randomization.md) and any [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/) placeholder.

## Formatting

* **Multiple lines** — in `[MESSAGE]`, `[BROADCAST]` and `[ANNOUNCE]`, the `|` character splits the text into separate lines.
* **Sound parameters** — `[sound] BLOCK_CHEST_OPEN,volume:0.2,pitch:1`. Both `volume` and `pitch` are optional.
* **Firework parameters** — `[firework] colors:{FF0000;00FF00;0000FF},type:BALL_LARGE,power:2`. Colors are hexadecimal and separated by `;`, `type` is a Bukkit firework type (`BALL`, `BALL_LARGE`, `STAR`, `BURST`, `CREEPER`), `power` sets the flight duration. All three are optional.
* **Per-line chance** — prefixing a statement with `<chance>:` executes that single line only that often, e.g. `'[console] 10: give %player% netherite_ingot 1'`. See [Execution Chances](/configuration/rewards/reward-features/randomization/execution-chances.md).

{% hint style="warning" %}
Item and sound names differ between Minecraft versions — always use names valid for the version you run.
{% endhint %}

## Example

The following example is a demonstration of how to use actions in a real .yml file of a reward:

```yaml
actions:
    - '[console] give %player% diamond 1' # console will execute the give command for 1 diamond
    - '[console] give %player% iron_ingot %exampleRandom%' # console will execute the give command for random amount of iron ingots
    - '[console] give %player% gold_ingot 3' # console will execute give command for 3 gold ingots
    - '[console] say %player% claimed his %type% reward!' # console will execute say command with specified message
    - '[console] 10: give %player% netherite_ingot 1' # only executes in 10% of the claims
    - '[actionbar] &aSuccessfully claimed!' # '&aSuccessfully claimed' message will be shown in player's action bar
    - '[title] &aClaimed' # '&aClaimed' message will be printed in a title for the player
    - '[subtitle] &aReward %tag%' # the reward's tag will be printed in a subtitle for the player
    - '[message] &7Enjoy your reward! | &7See you tomorrow.' # two lines, split by |
    - '[sound] BLOCK_CHEST_OPEN,volume:0.2,pitch:1' # The sound of the chest opening will be played for the player
    - '[bossbar] &aClaimed %type% reward' # Stated text will appear in boss bar for the claimer
    - '[firework] colors:{FF0000;00FF00;0000FF},type:BALL_LARGE,power:2' # Launches firework with stated colors, type & power above the player
```
