# Rewards

RageMode comes with a built-in reward system designed for players to receive things like custom items, execute commands and in game currencies. These rewards can be performed while playing a game or at the end of the game.

### Configure

```yml
end-game:
  commands:
    winner:
    - rm points add %player% 15
    players:
    - rm points add %player% 5
  items:
    winner:
    - customItemName
    players: []
```

`end-game` section is performed when a game is about to end, you have 2 options to reward 2 types players:

* `commands` - for performing specific commands
* `items` - for giving out [custom items](/ragemode-docs/guides/custom-items.md)
  * `winner` - the player who won the classic PvP game
  * `players` - all players except the winner who participated in classic PvP game

```yml
in-game-commands:
  death:
  - chance:0.1 msg %player% <dark_green>Better luck next time ;)
  join:
  - msg %player% <green>Enjoy our game!
```

`in-game-commands` section is performed when a game is currently running and specific actions happen for a player, these can be:

* `death` - when a player dies in game
* `join` - when a player joins to game
* `leave` - when a player leaves from a game
* `start` - when a game is about to start
* `stop` - when a game is stopped

You can as well configure each line of commands to execute with a pre-defined `chance` (optional):

```yml
start:
- chance:15.4 msg %player% <red>Game has started!
```

```yml
in-game-bonus:
  kill:
    player:
      chance: 35
      points-value: 20
      requirements:
        kill-quantity: 3
        points-amount: 0
      commands:
      - rm giveitem grenade %player% 3
      - effect give %player% regeneration 20 2
      - chance:5 effect give %player% luck 45 1
    zombie:
      chance: 5.8
      points-value: 3-5
      requirements:
        kill-quantity: 10
        points-amount: 0
      commands:
      - rm giveitem grenade %player% 2
      - effect give %player% regeneration 20 2
```

`in-game-bonus` is performed when a specific action happens in a game for `player` or `zombie`, these can be `kill` only. These are the options you can configure:

* `chance` - The chance value between `0-100` that this bonus can execute
* `points-value` - How many points can the player receive, define a single value (like `10` or a randomised `5-15`)
* `requirements` - The requirements that this bonus can execute
  * `kill-quantity` - How many the player need to kill x amount of entities to get this bonus (these are the total kills in a game)
  * `points-amount` - How many points are needed to get this bonus (these are the points you received in the game)
* `commands` - The list of commands to execute with this bonus

***

You can use these placeholders with commands

* `%world%` - world name
* `%player%` - player name
* `%game%` - game name
* and the [built-in ones](/ragemode-docs/placeholders.md#built-in-placeholders-for-use-inside-ragemode)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mdswork.gitbook.io/ragemode-docs/guides/rewards.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
