# 🏃 Parkour

> **Info:**
This module is configured in **modules/parkour.yml** inside the PhoenixLobby folder.

## Parkour

The parkour builds itself while the player runs, so there is nothing to build by hand. A player starts a run with **/parkour**, jumps as far as they can, and the run ends when they fall or when they use **/parkour stop**. The score is the amount of jumps they made.

Parkours are created from **Editor > Parkour**. Stand where you want the parkour to be and click **Add Parkour**.

<figure><img src="../../.gitbook/assets/parkour/add-parkour.png" alt="" width="563"><figcaption><p>Parkour (Add Parkour)</p></figcaption></figure>

A parkour needs two things before anyone can play it, the **Parkour Region** and the **Start Location**. Everything else is optional. Left-click the parkour in the list to open its editor: [Edit Parkour](edit-parkour.md), [Block Palette](#block-palette) and [Rewards](#rewards). Settings shared by every parkour on the server are on [Parkour Settings](settings.md).

## Commands

| Command                     | Description                                      |
| --------------------------- | ------------------------------------------------ |
| `/parkour`                  | Starts a random parkour the player has access to |
| `/parkour <identifier>`     | Starts a specific parkour                        |
| `/parkour stop`             | Leaves the run                                   |
| `/parkour top [identifier]` | Shows the leaderboard                            |

> **Info:**
The parkours themselves live under the **parkours** section at the end of the file.

## Block Palette

With this option, you can configure which blocks the generated jumps use. Left-click it to open the palette, where every block currently in use is listed.

<figure><img src="../../.gitbook/assets/parkour/block-palette.png" alt="" width="563"><figcaption><p>Edit Parkour (Block Palette)</p></figcaption></figure>

### Add Block

Inside the palette, **Add Block** puts another block into the list. Add as many as you like to give the run some variety.

<figure><img src="../../.gitbook/assets/parkour/add-block.png" alt="" width="563"><figcaption><p>Block Palette (Add Block)</p></figcaption></figure>

### Random Block Per Jump

With this option, you decide how the palette is used. When it is enabled, every jump picks a new block from the palette, which gives a colourful run. When it is disabled, one block is chosen for the whole run instead, so each attempt keeps a single look.

<figure><img src="../../.gitbook/assets/parkour/random-block-per-jump.png" alt="" width="563"><figcaption><p>Edit Parkour (Random Block Per Jump)</p></figcaption></figure>

> **Info:**
A palette with only one block makes this option have no visible effect.

## Rewards

With this option, you can configure the rewards given for reaching a certain score. Left-click it to open the reward list of the parkour.

<figure><img src="../../.gitbook/assets/parkour/rewards.png" alt="" width="563"><figcaption><p>Edit Parkour (Rewards)</p></figcaption></figure>

### Add Reward

Inside the list, **Add Reward** creates a new score reward. Each reward is its own entry with its own score and actions, so a parkour can hand out several of them during a single run.

<figure><img src="../../.gitbook/assets/parkour/add-reward.png" alt="" width="563"><figcaption><p>Rewards (Add Reward)</p></figcaption></figure>

### Required Score

With this option, you can change the score a player has to reach before the reward is earned.

<figure><img src="../../.gitbook/assets/parkour/required-score.png" alt="" width="563"><figcaption><p>Reward (Required Score)</p></figcaption></figure>

### Repeating

With this option, you define whether the reward is given every time the score is a multiple of the required score. With a required score of 10 and repeating enabled, the player is rewarded at 10, 20, 30 and so on. With it disabled, the reward is given once at 10 only.

<figure><img src="../../.gitbook/assets/parkour/repeating.png" alt="" width="563"><figcaption><p>Reward (Repeating)</p></figcaption></figure>

### Actions

With this option, you can edit the actions executed when the reward is earned. The same action types used by npcs and hotbar items are available here, so a reward can give money, run a command, send a message or play a sound.

<figure><img src="../../.gitbook/assets/parkour/actions.png" alt="" width="563"><figcaption><p>Reward (Actions)</p></figcaption></figure>

> **Info:**
A reward with no actions is still tracked, it simply does nothing when the score is reached.

## Placeholders

### Parkour Placeholders

| Placeholders                                 | Description                                   |
| -------------------------------------------- | --------------------------------------------- |
| %phoenixlobby\_parkour\_count%               | Returns the amount of playable parkours       |
| %phoenixlobby\_parkour\_playing%             | Returns the amount of users playing           |
| %phoenixlobby\_parkour\_playing\_\<parkour>% | Returns the amount of users playing a parkour |

The parkour is always the identifier you gave it in the editor, for example %phoenixlobby\_parkour\_playing\_lobbyjump%.

### Run Placeholders

| Placeholders                        | Description                            |
| ----------------------------------- | -------------------------------------- |
| %phoenixlobby\_parkour\_score%      | Returns the score of the current run   |
| %phoenixlobby\_parkour\_time%       | Returns the time of the current run    |
| %phoenixlobby\_parkour\_name%       | Returns the parkour of the current run |
| %phoenixlobby\_parkour\_difficulty% | Returns the difficulty of the current run |

> **Info:**
These are empty while the user is not on a parkour.

### Statistic Placeholders

| Placeholders                                     | Description                                               |
| ------------------------------------------------ | --------------------------------------------------------- |
| %phoenixlobby\_parkour\_gamesplayed%             | Returns the amount of runs the user finished              |
| %phoenixlobby\_parkour\_gamesplayed\_\<parkour>% | Returns the amount of runs the user finished on a parkour |
| %phoenixlobby\_parkour\_highscore%               | Returns the best score of the user on all parkours        |
| %phoenixlobby\_parkour\_highscore\_\<parkour>%   | Returns the best score of the user on a parkour           |
| %phoenixlobby\_parkour\_besttime%                | Returns the best time of the user on all parkours         |
| %phoenixlobby\_parkour\_besttime\_\<parkour>%    | Returns the best time of the user on a parkour            |
| %phoenixlobby\_parkour\_position%                | Returns the leaderboard position of the user              |
| %phoenixlobby\_parkour\_position\_\<parkour>%    | Returns the leaderboard position of the user on a parkour |

### Leaderboard Placeholders

| Placeholders                                                | Description                                    |
| ----------------------------------------------------------- | ---------------------------------------------- |
| %phoenixlobby\_parkour\_top\_\<parkour>\_\<position>\_name%  | Returns the name on that leaderboard position  |
| %phoenixlobby\_parkour\_top\_\<parkour>\_\<position>\_score% | Returns the score on that leaderboard position |
| %phoenixlobby\_parkour\_top\_\<parkour>\_\<position>\_time%  | Returns the time on that leaderboard position  |

For example, %phoenixlobby\_parkour\_top\_lobbyjump\_1\_name% returns the best player of that parkour.

> **Info:**
Leave the parkour out to use the global leaderboard, for example %phoenixlobby\_parkour\_top\_1\_name%. It ranks users by their best score on any parkour.

The leaderboard holds the top 20 by default, which you can change with the leaderboard size.

Source: https://www.phoenixplugins.com/docs/phoenix-lobby/modules/parkour