Configuration and Example/IconMenu's command type, Merchant GUI and BOOKs.


IconMenu Commands


ICONMENU COMMAND FIELDS :

iconmenu_title:
This field allow you to change the Header title of the inventory opened. Can be max 32 character.

iconmenu_size:
Change this value for manage the size of the Inventory.
This value must be an multiple of 9. (9, 18, 27, 36, 45 and 56).

iconmenu_commands:
Here, the main part of the Iconmenu.

 'POSITION:ITEM_NAME:ITEMDATA:COMMAND/MESSAGE:TITLE:DESCRIPTION;MULTILINES'


iconmenu_type:
Implemented in MyCommand 5.3.4, this field allow you to change the default type of inventory to open. For example, you can change it, to the DISPENSER Gui, and have an interface with 3x3 blocks.

Supported "WORKING" types :

CHEST (default), BREWING, DISPENSER, DROPPER, ENDER_CHEST, FURNACE, HOPPER, PLAYER, WORKBENCH


Not working or Glitched types:

ANVIL (some glitches) ,BEACON (dont'works) ,ENCHANTING (some glitches), MERCHANT (don't work) , CRAFTING (don't work), CREATIVE (don't work)

iconmenu_autofill:

Here from MyCmd 5.4.0, this function will fill your iconmenu empty space with the item you prefer.

Example  "iconmenu_autofill: BLUE_STAINED_GLASS"

 

iconmenu_itemflags:

 

iconmenu_itemflags:
- HIDE_ATTRIBUTES
- HIDE_DESTROYS
- HIDE_ENCHANTS
- HIDE_PLACED_ON
- HIDE_POTION_EFFECTS
- HIDE_UNBREAKABLE

 


Open an Iconmenu from another Iconmenu
Use "%openiconmenu%" as a prefix of the command to run in a iconmenu, for open another iconmenu.
Example :

  iconmenu_commands:
  - '0:WORKBENCH:0:%openiconmenu%/iconmenupage2:&2Next Page:&aChange page'

 

Enchants on items:
Use ; for split the item_name from the enchant_name :

0:ITEM_NAME;ENCHANTMENT_NAME;LEVEL:ITEMDATA:/command:Title:Description
Become :
0:STONE_SWORD;DAMAGE_ALL;1:0: ...ecc ecc.

or multiple enchantments :

 - 0:STONE_SWORD;DAMAGE_ALL;1;FIRE_ASPECT;1;DURABILITY;3:0:/command:Text:Text

Enchantment Bukkit API Names

Edit the amount of one ItemStack:

Put AMOUNT "comma" ITEMNAME ecc. Example :

0:32,GOLDEN_APPLE:0:/command:Title:Description

Make an Item unclickable :

Put %stayopen% in the command field. Example :

0:32,GOLDEN_APPLE:0:%stayopen%:Title:Description
  • If you want, you can run commands without closing the GUI, just addind the command after %stayopen%.
    • Example: "1:STONE:0:%stayopen%/command:Title:Description"

How to close the GUI without doing anything :

  • Use %close% as command. Just like the stayopen example.

Put multiple commands on one row

 

  • Use the character ";" to split multiple command in the "command" section.
'POSITION:ITEM_NAME:ITEMDATA:   /command1;/command2    :TITLE:DESCRIPTION;MULTILINES'

 

 

Skull Item or PLAYER_HEAD in the Iconmenu "Player texture on the icon"

From the release of Minecraft 1.13 the item is changed to PLAYER_HEAD.

 

 

  • you can use the item "SKULL_ITEM" with an player texture on it.
    • Example of use in Minecraft 1.12 and below: "1:SKULL_ITEM%Notch:0:/command:Title:Description"
    • Example of use in Minecraft 1.13 and above: "1:PLAYER_HEAD%Notch:0:/command:Title:Description"

 

How to put RGB colors to the POTION Items. (POTION, SPLASH_POTION and LINGERING_POTION)

 

Put the values like the playerhead name way, splitted by <rgb> 0 to 255 max.

 iconmenu_commands:
 - 1:POTION%255<rgb>120<rgb>0:0:/say hey:COLOR RGB TEST:RGB TEST

 

 

How to generate iconmenu interfaces faster? Is there somethign that can help me?

  • Using : /mycmd-edit command_name generateiconmenu , the command will get every icon in the user inventory and transform them in usable script lines   for "iconmenu_commands" config line. Support itemnames,enchantments and lores. [!] Warning, this will override your old "iconmenu_commands".

 

Command Example :

'example':
  command: /iconmenu
  type: ICON_MENU
  text:
  - 'POSITION:ITEM_NAME:ITEMDATA:COMMAND/MESSAGE:TITLE:DESCRIPTION;MULTILINES'
  iconmenu_title: '&cMyCommand &4ItemMenu'
  iconmenu_size: 27
  iconmenu_commands:
  - '0:GOLDEN_APPLE:0:/help:&2Help:&aOpen the help menu'
  - '1:COMPASS:0:/mycmd:Menu:MyCommand menu'
  - '9:EMERALD:0:/list:Player List:&bShow online players'
  - '10:WATCH:0:/time set 0:Day:Turn day'
  - '26:WOOL:11:%openiconmenu%/iconmenu2:Next Page:&cChange IconMenu Page;&a--------->'

Result (old img):
iconmenu

 

 

iconmenu_mode:

the iconmenu_mode command line allows you to use precreated or newer functionality to the iconmenu's GUI otherwise impossible to be done with the normal plugin usage.

 

Available options for iconmenu_mode :
PLAYER_LIST (create a iconmenu filled with all the online players head)
custom placeholder who works only with PLAYER_LIST : $playerhead (return the name of selected player head).

 


DYNAMIC
create the command like you have already done in the past and it automatically update every * delaytimer seconds.
use <next> between your Item name, Title and Description to create multiple items, titles and description to show at every refresh of the task.
use delaytimer to adjust the refresh rate. delaytimer: 1 = 1 second for refresh.
I've made AIR Working in the Iconmenu, so you can use it to "empty" a position.

 

line example :

 

  - 26:LEGACY_WOOL<next>PLAYER_HEAD<next>BARRIER<next>EMERALD<next>AIR:0:/launchacommand:Title1<next>Title 2<Next> Title3:Description1;still one<next> Description 2 ecc ecc ecc

Command example with multiple ITEMS, TITLES and DESCRIPTIONS

 

 

 

dynamiciconmenu:
  command: /dynamiciconmenu
  type: ICON_MENU
  iconmenu_size: 36
  iconmenu_mode: DYNAMIC
  permission-required: false
  iconmenu_commands:
  - '0:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '1:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '2:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '3:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '4:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '5:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '6:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '7:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '8:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '9:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '11:CLOCK:0:%stayopen%:&aServer time - $random_color$time:&bToday Date - &6 $todaydate'
  - '13:BEACON:0:/mycmd:&6MyCommand:&eLaunch MyCommand'
  - '15:ENDER_PEARL<next>ENDER_EYE<next>AIR:0:%stayopen%:???<next>!!!<next>AIR: '
  - '17:YELLOW_WOOL<next>LIME_WOOL:4:/command_example: : '
  - '18:LIME_WOOL<next>YELLOW_WOOL:5:/command_example: : '
  - '19:BOOK<next>2,BOOK<next>3,BOOK:0:%stayopen%:$random_colorPage 1<next>$random_colorPage2<next>$random_colorPage 3:1<next>2<next>3'
  - '22:1,IRON_CHESTPLATE<next>GOLDEN_CHESTPLATE;PROTECTION_ENVIRONMENTAL;1<next>DIAMOND_CHESTPLATE;PROTECTION_EXPLOSIONS;3:0:/command_example::Description'
  - '25:BARRIER:0:%close%:Close this menu:&cClick here;&cto close'
  - '26:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '27:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '28:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '29:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '30:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '31:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '32:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '33:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  - '34:LIME_WOOL<next>YELLOW_WOOL:5:%stayopen%: : '
  - '35:YELLOW_WOOL<next>LIME_WOOL:4:%stayopen%: : '
  delaytimer: 1

 

 

 

 

 P.S. Currently the menu can be close only performing any action in it. Pressing ESC from the keyboard can't be detected from the API, so i can't see when a player close it. Just don't create dead end iconmenu's.

 

 

The other iconmenu_mode, PLAYER_LIST example below :

iconmenu_playerlist:
 command: /iconmenu_list
 type: ICON_MENU
 iconmenu_title: '&aOnline Player List &b($online)'
 iconmenu_mode: PLAYER_LIST
 iconmenu_commands:
 - '%openiconmenu%/banmenu $playerhead'


Misc : Use $RUN_CONSOLE$ as a prefix of the command, to run it as console sender.

Merchant GUI


 

This one will open to you a Merchant Item GUI, where you can buy stuffs.

 

ITEM_TO_SELL<cost>ITEM_NEEDED_TO_BUY_1:AMOUNT<cost>ITEM_NEEDED_TO_BUY_2:AMOUNT<max_uses>AMOUNT

<max_uses>N -> Determinate how many times one thing can be bought.

 

Example :

 

merchant_example:
 command: /mymerchant
 type: MERCHANT
 merchant_title: '&3Hello &b$player'
 merchant_items:
 - STONE_SWORD:1:0:DAMAGE_ALL;1;FIRE_ASPECT;1:&3Old Sword:&bA very old sword<cost>GOLD_INGOT:20<max_uses>2
 - STONE_SWORD:1<cost>EMERALD:5<max_uses>4
 - IRON_BLOCK:1<cost>EMERALD:1<cost>GOLD_INGOT:1
 - GOLD_BLOCK:1<cost>IRON_INGOT:10
 - EMERALD_BLOCK:1<cost>GOLD_INGOT:50
 - DIAMOND_BLOCK:1<cost>GOLD_INGOT:50<cost>EMERALD:50
 - LEVER:1
 - COBBLESTONE:1

 

 

 


Create a BOOK command type:


 

Open up a Book GUI without the need of having a book in the inventory.

 

book1_test:
 command: /booktest
 type: BOOK
 text:
 - "&2Hello &a$player\n\n\n&3This is a book created with \n&9 MyCommand!\n\n\n\n\n\n\n\n &d -->&5 Next Page"
 - "Write what you want here!"
 book_title: MyCommand
 book_author: emmerrei
 book_add_to_inventory: false