# Sections

**Sections &** **Rewards:**

The rewards are organized into sections, and each section can contain several rewards. This separation allows distinguishing between rewards for regular players and VIP players, offering greater flexibility to customize each aspect of the server.

{% tabs %}
{% tab title="01" %}

<pre class="language-yaml" data-line-numbers><code class="lang-yaml">&#x3C;treasure name>:
  chance: 20.0
<strong>  sections:
</strong><strong>    &#x3C;section name 01>:
</strong><strong>      chance: 100.0
</strong><strong>      limit: 1
</strong><strong>      random: true
</strong><strong>      permission: "permission.name>"
</strong><strong>      rewards:
</strong><strong>        '1': 
</strong><strong>          # reward 01
</strong><strong>        '2': 
</strong><strong>          # reward 02
</strong>    &#x3C;section name 02>:
	  # options..
      rewards:
        '1': 
          # reward 01
        '2': 
          # reward 02
</code></pre>

{% endtab %}

{% tab title="02" %}
{% code lineNumbers="true" %}

```yaml
example:
  chance: 20.0
  sections:
    member:
      chance: 100.0
      limit: 1
      random: true
      permission: "minetreasures.section.member"
      rewards:
        '1': 
          chance: 60.0
          use-fortune: true
          item:
            material: 'REDSTONE'
            amount: 6
          commands:
          - "[ACTIONBAR] &eYou have found a magical treasure!"
          - "[MESSAGE] &6[Treasure] &7- &7You have found an &aFortune&7 treasure!"
    vip:
      chance: 100.0
      limit: 1
      random: true
      permission: "minetreasures.section.vip"
      rewards:
        '1': 
          chance: 60.0
          use-fortune: true
          item:
            material: 'DIAMOND'
            amount: 6
          commands:
          - "[ACTIONBAR] &eYou have found a magical treasure!"
          - "[MESSAGE] &6[Treasure] &7- &7You have found an &aFortune&7 treasure!"
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

### **`sections:`**

Defines the reward sections; they are used as reward groups.

**Example**:

{% code lineNumbers="true" %}

```yaml
  sections:
    <section name 01>:
      # .. options ..
      rewards:
        '1':
          # reward 01
        '2':
          # reward 01
    <section name 02>:
      # .. section rewards ..
```

{% endcode %}

***

### **`chance:`**

Defines the probability that the treasure will trigger, in percentage. Value between **0.001% and 100%**.\
The chance can be extremely low, going beyond **0.001%**.

**Example**:

{% code lineNumbers="true" %}

```yaml
chance: 10
# or
chance: 0.01
# or
chance: 10.0
```

{% endcode %}

***

### **`limit:`**

Maximum number of sections to be processed per treasure event. If the limit is not added, all treasures will attempt to trigger.

**Example**:

{% code lineNumbers="true" %}

```yaml
limit: 2
```

{% endcode %}

***

### **`random:`**

Determines whether the section selection will be random.

**Example**:

{% code lineNumbers="true" %}

```yaml
random: true
```

{% endcode %}

***

### **`permission:`**

Permission required to access the treasure.

**Example**:

{% code lineNumbers="true" %}

```yaml
permission: "minetreasures.conditions-treasures"
```

{% endcode %}

***

### **`rewards:`**

List of rewards that the player may receive.\
Examples of how to configure a reward can be found here: [rewards](https://pretti.gitbook.io/prtminetreasures/treasures/rewards/rewards "mention")

**Example**:

{% code lineNumbers="true" %}

```yaml
      rewards:
        '1': 
          chance: 60.0
          item:
            material: 'REDSTONE'
            amount: 6
          commands:
          - "[ACTIONBAR] &eYou have found a magical treasure!"
          - "[MESSAGE] &6[Treasure] &7- &7You have found a treasure!"
        '2': 
          chance: 20.05
          use-fortune: true
          item:
            material: 'REDSTONE'
            amount: 6
          commands:
          - "[ACTIONBAR] &eYou have found a magical treasure!"
          - "[MESSAGE] &6[Treasure] &7- &7You have found a &aFortune&7 treasure!"
```

{% endcode %}
