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, initial |
decimal | Floating point number | min, max, initial |
boolean | Toggle switch / true/false | initial |
option | Choice from defined options | options, initial |
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. - Injection Safety: Collected values are safely injected into
{input.<id>}with all formatting codes sanitized.