Inputs
EasyMenu 7 includes an Inputs system that collects values (text, numbers, booleans, dropdown options) from players when opening menus or clicking buttons.
In Native Dialogs, inputs render as interactive UI components (text fields, number sliders, switches). In Inventory GUIs, inputs seamlessly fall back to chat prompts.
Basic Form Input Example
Collect a purchase quantity from the player before executing the shop command:
# Menu-level input definitions
inputs:
- id: count
type: integer
label: "Enter quantity (1–64)"
min: 1
max: 64
initial: 1
menu-items:
- id: buy_diamond
slot: 13
material: DIAMOND
name: "&bBuy Diamonds"
input-refs:
- count # References the input defined above
command: "shop buy diamond {input.count}"
Input Types (type)
| Type | Description | Key Configuration Properties |
|---|---|---|
text | Free-form text string | max-length, initial |
integer | Whole integer number | min, max, max-length, initial |
decimal | Decimal number | min, max, max-length, initial |
boolean | Toggle switch / true/false | initial |
option | Choice from defined options | options, initial |
Keys shared by every input:
| Key | Default | Description |
|---|---|---|
id | Required | Identifier referenced as {input.<id>}. A duplicate within one menu is an error (duplicate-input-id). |
type | text | One of the types above. An unknown type is an error (invalid-input). |
label | The id value | Heading shown to the player. |
timeout-seconds | input.default-timeout-seconds in config.yml (default: 60) | Seconds to wait for chat input. 0 or less is an error. |
These are also errors: min greater than max, an option input with no options, duplicate option ids, and an item input-refs entry that names an undeclared input.
Writing min / max on a text / boolean / option input, or options on a non-option input, only logs a warning.
type: input actionThe inputs described here is the menu-wide input form, referenced through an item's input-refs.
The type: input action inside an item's actions is a separate mechanism that collects one value through chat only. It supports string / integer / decimal and the value is referenced as {input} (or the name set with variable). See Advanced Actions.
Option List Input (type: option)
inputs:
- id: rank_duration
type: option
label: "Select VIP Duration"
options:
- id: "1d"
display: "1 Day ($100)"
- id: "7d"
display: "7 Days ($500)"
- id: "30d"
display: "30 Days ($1,500)"
initial: "7d"
menu-items:
- slot: 13
material: NETHER_STAR
name: "&6Purchase VIP"
input-refs:
- rank_duration
command: "rank buy vip {input.rank_duration}"
Cross-Backend Validation Parity
Input values submitted via graphical dialog widgets and values entered through chat prompts are validated against the exact same rules (InputContract):
- Initial Value Validation: Initial values (
initial) are verified at reload time to ensure they satisfy the input requirements. - Length Limits:
text,integer, anddecimalreject input longer thanmax-length(default 128). Numeric inputs also check the length of the canonical plain representation before expanding exponential notation. - Injection Safety: Collected values are safely injected into
{input.<id>}with all formatting codes sanitized.
When a player types cancel during a chat prompt, the input is aborted and the item's remaining actions are not run.