# Mailbox

This module allows you to create a mailbox for your players' items. When the plugin gives an item to a player, it checks if there is space in their inventory. If not, the item is sent to their mailbox. The item will expire after a configurable number of days.

The plugin's API allows other plugins to add items to the mailbox. For example, an AuctionHouse plugin (such as [zAuctionHouse](https://www.spigotmc.org/resources/1-8-1-20-zauctionhouse-2000-servers.63010/)) can integrate with zEssentials to deliver items directly to the mailbox instead of using the plugin's pending inventory system.

<figure><img src="https://3650476264-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAyz09ASs8veyxsflZ9y%2Fuploads%2FzVAiwA6vRsWI6dPqOIss%2Fmailbox.gif?alt=media&#x26;token=abd32f67-3095-4f39-b795-93fe547d98ed" alt=""><figcaption></figcaption></figure>

## Configuration

### Config.yml

```yaml
########################################################################################################################
#
# ███╗░░░███╗░█████╗░██╗██╗░░░░░██████╗░░█████╗░██╗░░██╗
# ████╗░████║██╔══██╗██║██║░░░░░██╔══██╗██╔══██╗╚██╗██╔╝
# ██╔████╔██║███████║██║██║░░░░░██████╦╝██║░░██║░╚███╔╝░
# ██║╚██╔╝██║██╔══██║██║██║░░░░░██╔══██╗██║░░██║░██╔██╗░
# ██║░╚═╝░██║██║░░██║██║███████╗██████╦╝╚█████╔╝██╔╝╚██╗
# ╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝╚══════╝╚═════╝░░╚════╝░╚═╝░░╚═╝
#
# Documentation: https://zessentials.groupez.dev/modules/mailbox
#
########################################################################################################################

enable: true

# The expiration time of items when added to the mailbox
# If the player does not recover his items with expiration they will be deleted permanently.
expiration: 86400
```

### Mailbox Inventory

Inventory of the mailbox, the items will be displayed thanks to the button `ZESSENTIALS_MAILBOX`

```yaml
name: "#3f3f3fᴍᴀɪʟʙᴏx"
size: 54
items:
  items:
    isPermanent: true
    type: ZESSENTIALS_MAILBOX
    item:
      lore:
        - ''
        - '#ffd353ℹ Informations#3f3f3f:'
        - '#3f3f3f• &7Expires in#3f3f3f: #4cd5ff%expiration%'
        - ''
        - '&f➥ &nLeft Click&r&7 to get the kit'
    slots:
      - 0-44
    else:
      slots:
        - 22
      item:
        material: BARRIER
        name: '&c&nNo Items Found'
  info:
    isPermanent: true
    slot: 49
    item:
      material: BELL
      name: '&fᴍᴀɪʟʙᴏx'
      lore:
        - ''
        - '#ffd353ℹ Informations#3f3f3f:'
        - '#3f3f3f• &7The mailbox allows you to store items'
        - '#3f3f3f• &7 so that you can recover them later'
        - ''

  previous:
    isPermanent: true
    type: PREVIOUS
    slot: 45
    item:
      url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjllYTFkODYyNDdmNGFmMzUxZWQxODY2YmNhNmEzMDQwYTA2YzY4MTc3Yzc4ZTQyMzE2YTEwOThlNjBmYjdkMyJ9fX0="
      name: "#92bed8ᴘʀᴇᴠɪᴏᴜs ᴘᴀɢᴇ"

  next:
    isPermanent: true
    type: NEXT
    slot: 53
    item:
      url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODI3MWE0NzEwNDQ5NWUzNTdjM2U4ZTgwZjUxMWE5ZjEwMmIwNzAwY2E5Yjg4ZTg4Yjc5NWQzM2ZmMjAxMDVlYiJ9fX0="
      name: "#92bed8ɴᴇxᴛ ᴘᴀɢᴇ"

```
