# 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="/files/OpQIVfelYmfXsXdIRgQu" 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shimado.gitbook.io/fungames/modes/lottery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
