# Presents

For each present picked up, the player receives a certain reward. Presents are specified manually by the admin. After a certain cycle, they are restored. Also in the config, you can activate the option for random spawning of a present near the player in a certain range near him.

<figure><img src="https://2659314113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9UifqN2U4R2HCXiT8aMn%2Fuploads%2FjIVGOiUKq5JwJO3BuIvU%2Fpresent.png?alt=media&#x26;token=c70bdeb8-aef8-4e2c-8bf5-1850e89f8cfd" alt=""><figcaption><p>Default</p></figcaption></figure>

### Installation <a href="#installation" id="installation"></a>

Stand on the block where you want to place the gift block. But you can create more types.

```
/present add
```

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

| Description                                                                                                                                                    | Command                                                       |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| View mode commands                                                                                                                                             | /present help                                                 |
| Adds +1 spawn point for the present                                                                                                                            | /present add                                                  |
| Removes the present that the player is looking at                                                                                                              | /present remove                                               |
| Adds an item to your hand as a prize when pick up a present. You need to specify the drop chance. Be sure to change the drop type in the config for this mode. | /present additem <mark style="color:purple;">\<chance></mark> |

### 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.present.\*     |
| Gives the player permission to create/delete presents | fun.present.create |
| Gives the player permission to open presents          | fun.present.open   |

### Main config (config.yml)

```yaml
Presents enable: true #If "false", this mode will not be available
Presents min server online: 0 #How much online must be on the server in allowed worlds for the mode to work
Presents head settings: #As list. [Material or head value, Custom model data, FunGames animation]
  - ['eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWI2NzMwZGU3ZTViOTQxZWZjNmU4Y2JhZjU3NTVmOTQyMWEyMGRlODcxNzU5NjgyY2Q4ODhjYzRhODEyODIifX19', 0, 'PRESENT_1']
  - ['eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDZmMTYyNjEwN2U4MmFmZjlkOWUyMGY0MTc4NmE2YzUwZDllMzY2ZThhYmU5M2MyMWZjOTA4MTVmNWJlOGNjOSJ9fX0', 0, 'PRESENT_2']
  - ['eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWNhNjQzYTUzOWMyNzU3NTU3MzcwOGM1YTQyNmFkNjIwM2JjNTE5NzQ5ZmIxNDllZjdmMWIyYTY4MzM5OCJ9fX0', 0, 'PRESENT_3']
  - ['eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmU2ZTY1MmFkYzBhNGY1YmY0MmE3ZjhkOGM3Njk4YjFlYWI4YTZiYzA5YWUzZjJkNzM5NDZiN2UzNTU1MDQ3In19fQ', 0, 'PRESENT_4']
  - ['eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmQ3ZDQ0ZTg2NDQ4YTk2YmI1YmIyM2UyNGEyMWE2NjViNzNmODU2YmExMGRlNDJmNTc3YzY4OGMxOTE4ZiJ9fX0', 0, 'PRESENT_1']
Presents interval: 300 #In ticks. How long present will be active and player can pick up it
Presents delay: 120 #In ticks. Delay between intervals
Presents send spawn messages to all worlds: false #Write a message to all the worlds
Presents title enable: true #Will the title be displayed when you win?
Presents title fade in time: 10 #In ticks
Presents title stay time: 40 #In ticks
Presents title fade out time: 10 #In ticks
Presents fireworks: #Victory animations. You can set 1 and more animations. Or set [] to disable
  - 'SALUT_3'
Presents random enable: false #Will the gift spawn randomly near the player?
Presents random interval: 60 #In seconds. How much time is given to pick up a gift?
Presents random delay: 1200 #In seconds.
Presents random chance to spawn near player: 0.5 #Chance to spawn a present near the player
```

### Mode config (presents.yml)

```yaml
Presents rewards:
  Drop mode: MONEY
  Money reward: 1000.0
  Items reward: [] #Set by command
  Command reward: []

Presents locations: [] #Set by command
```

You can change the type of reward. Just change it in the config above. Here are what they are:

1\) **MONEY** - Gives only money

2\) **ITEM** - Gives only one item with some chance

3\) **ALLITEMS** - Gives all items in list

4\) **COMMAND** - Executes commands. Example:

```
Command reward:
- eco give %player% 1000
- say Cool
```
