# Lottery

The lottery is held in specified intervals. These intervals can be set in the config.&#x20;

For example, it starts at 8 am, ends at 1 pm, and starts again at 7 pm and lasts until 11 pm.&#x20;

At this time, each player can buy a ticket. If many players buy tickets, then this bank will be played between 1st, 2nd and 3rd place. Although it is possible to make one winner.

<figure><img src="https://2659314113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9UifqN2U4R2HCXiT8aMn%2Fuploads%2FyoszxFvqXN42APD70pqf%2Flottery.png?alt=media&#x26;token=99ba1167-839c-4af9-826f-2b179970ca05" alt=""><figcaption></figcaption></figure>

### Commands <a href="#commands" id="commands"></a>

| Description                                                            | Command       |
| ---------------------------------------------------------------------- | ------------- |
| View mode commands                                                     | /lottery help |
| Buy a ticket to participate in the lottery                             | /lottery buy  |
| View the current bank and find out how much time is left until the end | /lottery info |

### Permissions <a href="#permissions" id="permissions"></a>

{% hint style="danger" %}
You **must** use a permission manager like [LuckPerms](https://luckperms.net/download) which supports `.*` permissions notation. Bukkit doesn't support this notation by default!
{% endhint %}

| For what                                      | Permission       |
| --------------------------------------------- | ---------------- |
| Gives all mode access to the player           | fun.lottery.\*   |
| Gives the player permission to play this mode | fun.lottery.play |

### Main config (config.yml)

```yaml
Lottery enable: true #If "false", this mode will not be available
Lottery ticket price: 1500.0 #Ticket price for which you can participate in the lottery
Lottery can player buy more than 1 ticket: false #Is it possible to buy more than 1 ticket to increase your chances of winning?
Lottery min amount of players: 4 #How many minimum players must participate in the lottery? Otherwise the money will be returned
Lottery notifications interval (in minutes): 10 #After how many minutes will messages appear indicating that a lottery is currently underway
Lottery prizes: #Distribution of total bank odds. More places can be set
  1: 60.0
  2: 25.0
  3: 15.0

Lottery use time start: true #If "true", then the lottery will be tied to server time. The first number is the start time, the second is the end
Lottery event intervals: #hours-minutes
  - ['08-00', '09-58']
  - ['10-00', '11-58']
  - ['12-00', '13-58']
  - ['14-00', '15-58']
  - ['16-00', '17-58']
  - ['18-00', '19-58']
  - ['20-00', '21-58']

Lottery time for event (in minutes): 118 #If "Lottery use time start" is false, that's how many minutes the lottery will last
Lottery cooldown (in minutes): 2 #Pause between lotteries
```
