Menus

How to create item-menu

There's two ways to create item-menu using ReActions.

1. Use action MENU_ITEM to define all menu in one line.

This method is is inconvenient, especially when you need to create big GUI. But it useful when you need to create small (one or two slots menu).

Activator example

BUTTON:
testmenu:
  world: world
  x: -483
  y: 5
  z: 490
  flags: []
  actions:
  - MENU_ITEM=size:9 title:{ReActions menu} slot1:{name:{Execute exec1 activator} type:DIAMOND} exec1:exec1 slot2:{name:{Execute exec2 activator} type:DIAMOND}
  reactions: []

Command example:

/react add testmenu a MENU_ITEM size:9 title:{ReActions menu} slot1:{name:{Execute exec1 activator} type:DIAMOND} exec1:exec1 slot2:name:{Execute exec2 activator} type:DIAMOND}

2. Using pre-configured menus.

Menu configuration is saved to file menu.yml and this menu could be show using action MENU_ITEM with parameter id, that points to menu name.

Configuration example (file menu.yml):

test:
 title: This is a test menu!
 size: 18
 slot1:
   item: '&6Execute activator exec1$DIAMOND'
   activator: exec1
 slot3:
   item: DIRT
   activator: exec2

Activator that will show this menu:

BUTTON:
 testmenu:
   world: world
   x: -483
   y: 5
   z: 490
   flags: []
   actions:
   - MENU_ITEM=menu:test
   reactions: []

Commands

Create new menu

/react add menu <MenuId> [Size] [Title]

Setup menu parameters

/react set id:<MenuId> <Parameter>:<Value>

<Parameter> is: size, title, item1, ..., itemN, activator1, ..., activatorN.

Remove menu

/react remove menu <MenuId>

Show menu list

/react list menu <MenuId> [PageNumber] [Mask]

Show menu configuration:

/react info menu <MenuId>

Example:

/react add test 18 This is a test menu!
/react set menu id:test item1:{&6Execute activator &4exec1$DIAMOND} activator1:exec1
/react set menu id:test item3:DIRT activator3:exec2
/react add action MENU_ITEM menu:test