# 🎮 Elo Ranks

## Information

The Elo ranks add-on adds ranks to PhoenixDuels. The add-on includes five default ranks: Bronze, Silver, Gold, Diamond and Emerald.

<figure><img src="https://cdn.phoenixplugins.com/9k0q3ltrxlhdz6s6t4is65tgbol6" alt="" width="188"><figcaption><p>Elo Ranks - Add-On </p></figcaption></figure>

👉 [You can purchase this add-on on Phoenix Store](https://www.phoenixplugins.com/product/elo-ranks-add-on)

## Installation&#x20;

To install this add-on, simply drag and drop the jar file into the PhoenixDuels/addons folder, then restart your server.

The add-on will generate its contents to the following default files of the PhoenixDuels folder:
- `config.yml` the command for the `/ranks` menu
- `elo.yml` the configuration for the ranks

## Create a Rank

By clicking here, you can create a new rank. The default ranks are: Bronze, Silver, Gold, Diamond, and Emerald.&#x20;

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/elo_ranks_add.png" alt="" width="563"><figcaption><p>Editor > Settings > Elo > Ranks</p></figcaption></figure>

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/elo_ranks_create.gif" alt="" width="563"><figcaption><p>Editor > Settings > Elo > Ranks</p></figcaption></figure>

```yaml
ranks:
  '0':
    identifier: bronze
    display:
      ==: org.bukkit.inventory.ItemStack
      DataVersion: 4671
      id: minecraft:brick
      count: 1
      components:
        minecraft:custom_name: '{extra:["&6Bronze"],text:""}'
      schema_version: 1
    elo: 750
    actions:
      rank-up:
        - '[MESSAGE] &eYou ranked up!'
      rank-down: []
      unique-rank-up: []
```

### Rank Sorting

The ranks are sorted based on their ELO values, with the lowest appearing first and the highest appearing last.

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/elo_ranks_default.gif" alt="" width="563"><figcaption><p>Editor > Settings > Elo > Ranks</p></figcaption></figure>

## Edit a Rank

### Identifier

With this option, you can set an identifier for the rank. Note that the arena identifier is unique and used internally by the plugin, and it's different from the display name.

> **Danger:**
If your server is in production, we don't recommend changing this value.

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/elo_ranks_identifier.png" alt="" width="563"><figcaption><p>Editor > Settings > Elo > Ranks > Rank</p></figcaption></figure>

### Display

With this option, you can adjust the display name of the rank, the material that it will have, and its lore.

For the display name, you can use the default Minecraft color codes. For hex colors, use the \&#D6D045 format.

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/elo_ranks_display.gif" alt="" width="563"><figcaption><p>Editor > Settings > Elo > Ranks > Rank</p></figcaption></figure>

### Elo Required

With this option, you can define the required elo which players need to reach to get that rank.

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/elo_ranks_elo.png" alt="" width="563"><figcaption><p>Editor > Settings > Elo > Ranks > Rank</p></figcaption></figure>

### Actions

With this option, you can execute actions when a player ranks up, ranks down, or ranks up for the first time.

The first-time actions only run while the player is online. A player who earns a rank and leaves before they run, such as by quitting as the match ends, gets them the next time they join.

👉 [You can view the Action System here](../../plugins/action-types.md)

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/elo_ranks_actions.gif" alt="" width="563"><figcaption><p>Editor > Settings > Elo > Ranks > Rank</p></figcaption></figure>

## Ranks Menu

/ranks shows players every rank on the server, ordered by the elo needed to reach it, from lowest to highest. Each entry uses that rank's own display item, name and lore, so the menu reflects whatever you set up in the editor without any extra configuration.

The entries are informational; clicking one does nothing. The menu is there so players can see what the ladder looks like and what the next rank costs. Bedrock players get the ranks as a form, see [GeyserMC (Bedrock)](../../configurations/geysermc-bedrock.md).

<figure><img src="../../.gitbook/assets/add-ons/elo-ranks/ranks-menu.png" alt="" width="563"><figcaption><p>Ranks</p></figcaption></figure>

### The Command

The command is registered by the add-on into the plugin's own `config.yml`, so it is renamed or switched off there like any other PhoenixDuels command:

```yaml
commands:
  ranks:
    enabled: true
    alternative: ranks
```

### Customization

The menu itself lives in menus/elo/ranks.yml under the `ranks` key, and holds the layout, the close button, the filler row and the pagination arrows, which appear once there are more ranks than fit on a page.

The `rank` section is what each rank entry looks like. It takes three placeholders, filled in per rank:

| Placeholder     | Value                                    |
| --------------- | ---------------------------------------- |
| `%rank_name%`   | The rank's display name.                 |
| `%rank_lore%`   | The rank's display lore.                 |
| `%rank_elo%`    | The elo required to reach the rank.      |

```yaml
rank:
  name: '&a%rank_name%'
  lore:
    - '&a%rank_lore%'
    - ''
    - '&fElo Required: &e%rank_elo%'
```

The display item, name and lore of a rank are edited on the rank itself, not here. See [Edit a Rank](#edit-a-rank).

## Placeholders

The following is the list of the available placeholders that Elo ranks has. 

| Placeholders                                | Description                                           |
|---------------------------------------------|-------------------------------------------------------|
| %phoenixduels_elo_rank%                     | Returns the identifier of the players current rank.   |
| %phoenixduels_elo_rank_display%             | Returns the display name of the players current rank. |
| %phoenixduels_elo_rank_next%                | Returns the identifier of the players next rank.      |
| %phoenixduels_elo_rank_next_display%        | Returns the display name of the players next rank.    |
| %phoenixduels_elo_rank_elo_required%        | Returns the elo required for the player to rank up.   |
| %phoenixduels_elo_rank_progress_percentage% | Returns the % to level up a rank.                     |
| %phoenixduels_elo_rank_progress_bar%        | Returns a progress bar to level up a rank.            |

Source: https://www.phoenixplugins.com/docs/phoenix-duels/add-ons/elo-ranks