# Classes

BattleArena comes pre-installed with a classes module that lets you configure classes for an arena.

### Configuring the Module

This module can be enabled by adding **classes** to the **modules** section of your [Arena Configuration](https://docs.bplug.in/books/user-guide/page/arena-configuration).

#### Classes Configuration

This module adds a **classes.yml** to BattleArena, which can be found in **plugins/BattleArena/classes.yml**. Here is an example of a class included inside of the classes YML file:

```yaml
classes:
  warrior:
    name: Warrior # The name of the class
    # The items included in the class
    items:
      - iron_sword
      - cooked_beef{amount=16}
      - golden_apple{amount=2}
    # What the player will be given in their armor/offhand slots
    equipment:
      helmet: iron_helmet
      chestplate: iron_chestplate
      leggings: iron_leggings
      boots: iron_boots
      offhand: shield
```

Additionally, if you wish to restrict certain classes by arena, the classes.yml file includes a **require-permission** option (default: true), which means the player must have the "battlearena.classes.equip.&lt;class&gt;" permission.

#### Arena Configuration

By default, this feature is used in the built-in [arena.yml](https://github.com/BattlePlugins/BattleArena/blob/master/plugin/src/main/resources/arenas/arena.yml), and is configured to let you "select" a class while in a waiting or countdown phase, with the class being equipped once the game enters the ingame phase. The options used are documented below.

### Options

<table border="1" id="bkmrk-option-description-s" style="border-collapse: collapse; width: 100%; height: 415.6px;"><colgroup><col style="width: 16.2098%;"></col><col style="width: 40.2882%;"></col><col style="width: 43.502%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">**Option**

</td><td style="height: 29.8px;">**Description**  
</td><td style="height: 29.8px;">**Syntax**  
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">class-equipping  
</td><td style="height: 29.8px;">Whether class equipping is enabled using the /&lt;arena&gt; equip &lt;class&gt; command.  
</td><td style="height: 29.8px;">class-equipping={enabled=&lt;true|false&gt;}</td></tr><tr><td>class-equip-only-selects  
</td><td>Whether class equipping only "selects" a class, and must be applied in the arena by using the **equip-class** option.  
</td><td>class-equip-only-selects={enabled=&lt;true|false&gt;}  
</td></tr></tbody></table>

### Actions

- **&lt;, &gt;** denotes a *required* option
- **\[, \]** denotes an optional option
- Options are separated using the semicolon (**;**)

##### Equip Class

- Description: Equips a class for a player
- Options 
    - **&lt;class&gt;** The class to equip. By default, if a player has selected a class, this will only run if they have not selected one
    - **\[clear-inventory\]** Whether the player's inventory should be cleared when they select a class (default: true)
    - **\[ignore-player-selection\]** Whether a player's selection should be overridden (default: false)
- Syntax 
    - equip-class{class=**&lt;class&gt;**;clear-inventory=**\[clear-inventory\]**;ignore-player-selection=**\[ignore-player-selection\]**}