# Custom Menus

You can create custom menus in the `Aurora/gui/menus` folder. You can create subfolders as well inside this folder. Menu filenames must use lowercase english alphabet, numbers and underscore.&#x20;

{% hint style="warning" %}
Every filename must be unique since that will be the ID of the menu.
{% endhint %}

## Example configuration

```yaml
# What commands should open the menu?
# Changing this might require a full server restart depending on server version
# (Optional, can be deleted)
register-commands:
  - "mymenu"

# Title of the inventory
title: "&6Example Menu"
# How many rows should the inventory have?
rows: 6

# Should we refresh the menu periodically? (most of the times, you don't need this)
# (Optional, can be deleted)
refresh: false
# How often should the menu be refreshed? (in seconds, minimum 1, has to be an integer)
# (Optional, can be deleted)
refresh-interval: 5

# What are the requirements for opening the menu? can be multiple
# (Optional, can be deleted)
open-requirements:
  - requirement: "[permission] example.permission"
    # What should happen when this requirement isn't met?
    deny-actions:
      - "[message] You do not have permission to open this menu."

# What should we run when the menu opens? 
# (Optional, can be deleted)
open-actions:
  - "[sound] entity.villager.yes"

# What should we run when the menu gets closed?
# (Optional, can be deleted)
close-actions:
  - "[sound] entity.villager.no"

# Default item to fill the GUI with
# (Optional, can be deleted)
filler:
  material: black_stained_glass_pane
  hide-tooltip: true

# These are the items for the gui.
# For more info, see Item config and Requirement pages
items:
  test:
    # Higher priority means if both items are visible on the same slot, this will win
    priority: 1
    # When periodic refresh is enabled only those items will be refreshed
    # that has refresh: true
    refresh: true
    material: diamond
    name: "&6Test Item"
    lore:
      - "&7%server_time_hh:mm:ss%"
    slot: 13
    on-click:
      - "[open-gui] aaa"
    view-requirements:
      - "![permission] example.permission"
  test2:
    priority: 0
    material: emerald
    name: "&6Test Item {arg_test}"
    lore:
      - "&7This is a test item."
    slot: 13
    on-click:
      - "[console] say Hello world {arg_test}!"
      - "[permission] example.permission"
    click-requirements:
      - requirement: "[arg] test == example"
        deny-actions:
          - "[message] test arg is not example! It is {arg_test}"
```

## Opening a menu

You can open a menu/gui either by the defined `register-commands` or via the `/aurora gui open <player> <menu> [...args]`command.

```
/aurora gui open <player> <menu> arg1={some value} test={10}
```

If you are trying to open the menu from another menu, you can use the `[open-gui]` action.

```
[open-gui] menu_id arg1={some value} test={10}
```

## Menu arguments

As you have seen above, you can pass arguments to menus. You can reference these arugments anywhere by using this syntax: `{arg_key}`. So for the above example: `{arg_test}`. You can also use these in requirements to control menu item visibility or click requirements.

## Actions

For the possible click/open/close actions please see [Command dispatcher](/aurora/command-dispatcher.md).&#x20;

Everywhere you see `on-click` you can also define an `on-left-click` and `on-right-click` as well.

## Requirements

You can view the available view/open/click requirements here: [Requirements](/aurora/custom-menus/requirements.md).&#x20;

Everywhere you see `click-requirements` you can define `left-click-requirements` and `right-click-requirements` as well.


---

# 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://docs.auroramc.gg/aurora/custom-menus.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.
