# 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="/files/pMXCWoGc96F5luuBuQmq" 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ᴛ ᴘᴀɢᴇ"

```


---

# 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://zessentials.groupez.dev/modules/mailbox.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.
