# Gender

## ⚙️ Gender Configuration Guide

This section explains how to configure a new individual genre in the PlayerGender plugin using a .yml.\
All genres are defined in the same file (config.yml) located in the plugin folder. A complete breakdown of the configuration fields is shown below.

***

### 🔖 Basic Information

{% hint style="info" %}
All genders are defined in the items section:
{% endhint %}

#### Basic Structure Gender

The only thing you need to know is that in the type: GENDER section you must define it as such so that the plugin knows that it is a gender.\
Since you can use type: RESET to reset the current gender.

```yaml
items:
  male:
    slot: 11
    type: GENDER
    item:
      material: DIAMOND_SWORD
      name: "&9Male"
      lore:
        - "&7Click to select your gender"
        - "&9Male"
    prefix:
      enabled: true
      value: ' &b♂'
    actions:
      - "[message] &aYou selected &b♂ Male"
      - "[close]"
```

Structure Reset

<pre class="language-yaml"><code class="lang-yaml"><strong>items:
</strong><strong>  reset:
</strong>    slot: 22
    type: RESET
    item:
      material: BARRIER
      name: "&#x26;cReset Gender"
      lore:
        - "&#x26;7Click to remove your current gender"
    actions:
      - "[message] &#x26;cYour gender has been reset"
      - "[close]"
</code></pre>

***

### 🛠️ Actions on Equip

Actions define what happens when a gender is equipped. You can mix as many as you want. They are executed in order.

#### 📦 List of All Available Actions

| Action            | Description                                        | Example                                                                                 |
| ----------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `[command]`       | Executes a command as **console**                  | `[command] eco give {player} 500`                                                       |
| `[player]`        | Executes a command as **player**                   | `[player] /spawn`                                                                       |
| `[message]`       | Sends a private message                            | `[message] &aReward claimed!`                                                           |
| `[broadcast]`     | Sends a global message                             | `[broadcast] &e{player} claimed a reward!`                                              |
| `[sound]`         | Plays a sound to the player                        | `[sound] ENTITY_PLAYER_LEVELUP;1.0f;1.0f`                                               |
| `[title]`         | Displays a title                                   | `[title] &aCLAIMED;&fReward received;10;20;10`                                          |
| `[actionbar]`     | Shows actionbar message                            | `[actionbar] &eYou got 10 coins!`                                                       |
| `[close]`         | Closes the player's inventory                      | `[close]`                                                                               |
| `[minimessage]`   | Sends MiniMessage to the player                    | `[minimessage] <green>You claimed a reward!</green>`                                    |
| `[minibroadcast]` | Broadcasts MiniMessage globally                    | `[minibroadcast] <gold>{player}</gold> claimed <green>VIP reward</green>`               |
| `[chance=x]`      | Sets a probability for the following action(s)     | `[chance=50] [command] say Lucky player!`                                               |
| `[log]`           | It will display a message on the server backend.   | `[log] server log`                                                                      |
| `[firework]`      | Launches a firework with the desired configuration | `[firework] colors=RED,BLUE;fade=WHITE;type=BALL_LARGE;power=2;flicker=true;trail=true` |
| `[permission]`    | Adds permissions to the player (Requires Vault)    | `[permission] server.permission`                                                        |
| `[!permission]`   | Remove player permissions (Requires Vault)         | `[!permission] server.permission`                                                       |
| `[opcommand]`     | Execute a command like op (Not recommended to use) | `[opcommand] gamemode creative`                                                         |

> 📝 Use `{player}` to reference the player's name.\
> ⏱ You can delay actions using `<delay=ticks>` (e.g. 20 ticks = 1 second).

#### 📌 Example Block

```yaml
actionsOnClaim:
  - '[command] eco give {player} 1000'
  - '[player] /rewards'
  - '[message] &aYou received your daily reward!'
  - '[sound] ENTITY_EXPERIENCE_ORB_PICKUP;1.0f;1.0f'
  - '[broadcast] &e{player} has claimed the Daily Reward!'
  - '[title] &a&lREWARD;&fClaimed Successfully!;10;20;10'
  - '[log] Server log'
  - '[permission] example.permission'
  - '[!permission] example.permission'
  - '[firework] colors=RED,BLUE;fade=WHITE;type=BALL_LARGE;power=2;flicker=true;trail=true'
  - '[actionbar] &a+1000 Coins'
  - '[close]'
  - '[chance=30] [command] crate givekey {player} vote 1'
```

***

Need help building conditions or actions? Join our Discord or open an issue!
