Skip to main content

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)

TypeDescriptionKey Configuration Properties
textFree-form text stringmax-length, initial
integerWhole integer numbermin, max, initial
decimalFloating point numbermin, max, initial
booleanToggle switch / true/falseinitial
optionChoice from defined optionsoptions, 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.