1. Configuration and Example/1.2 IconMenu's command type, ANVIL GUI, SIGN MENU, 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"
Or MyCmd 5.6.6+, more customized one's like :
iconmenu_autofill: "STAINED_GLASS_PANE:14:true:&aHey&b$player: And this is the lore; line 2". ITEM : DATA : ENCHATED TRUE OR FALSE : TITLE : LORE
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
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_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. If you need too, you can put multiple commands.
Custom Textures:
Use custom playerhead texture inside the ICON_MENU with this feature.
Place the texture "code" instead of the player name to get what desidered. Get the texture code from website like https://minecraft-heads.com/
Example:
textured_head_iconmenu: command: /texturedhead type: ICON_MENU iconmenu_title: '&cTextured heads example' iconmenu_size: 18 iconmenu_commands: - "0:PLAYER_HEAD%eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzY2NGU1NGU3NjI4N2UzZmUyYmQzOTdjMDk4ZWU3YTRiZDBmOWM4OGY5MzlmZGU4YmFiNzhjMzI3MWE0NjE4ZiJ9fX0=:0:%stayopen%:Discord Server:link" - "9:PLAYER_HEAD%eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDRiOThlODQyZTMyNzMzYTdlNzVlMDJjZDU5NDRmYWNjNTAyNzg1ZTE1ZTE2ZWZiN2FkMGJiNDZhZGZmMTVmNiJ9fX0=:0:%stayopen%:Youtube Channel:link" - "17:PLAYER_HEAD%eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWQ5YzkzZjhiOWYyZjhmOTFhYTQzNzc1NTFjMjczODAwMmE3ODgxNmQ2MTJmMzlmMTQyZmM5MWEzZDcxM2FkIn19fQ==:0:%close%:Go Back:go back" iconmenu_autofill: WHITE_STAINED_GLASS_PANE
P.S. Pressing ESC from the keyboard can't be detected if you haven't enabled the INVENTORY_LISTENER in config.yml. So, INVENTORY_LISTENER: true
If you want, you can leave it on false, but to close any dinamic menu, you are foorced to perform an action.
How to use CustomModelData value 5.6.8+
This allow's you to use custom textured items from plugin like (ItemsAdder) into your IconMenu.
To use them place the numeric custommodeldata number right after the data id, splitted by a ;
- 1:ITEM_NAME:0; <CUSTOM MODEL DATA ID HERE > :/test:Title:Description -> - 1:ITEM_NAME:0;1:/test:Title:Description ->
How to use the $Script$ feature inside an IconMenu's (like runcmd) 5.6.8+.
It's possible create iconmenu's who can differs by a statement. Check the example below to see how implement them.
questscommand: command: /quests type: ICON_MENU iconmenu_size: 18 register: true permission-required: false iconmenu_title: GlobalMining Quest iconmenu_commands: - "$Script$%if%$PlayerData%RookieHunteFinished%==true" - 0:1,WRITTEN_BOOK:0:/warp quest1:§aRookie Hunter - "$Script$%else%" - 0:1,WRITABLE_BOOK:0:/warp quest1:§aRookie Hunter - "$Script$%if%$PlayerData%StartingHunterFinished%==true" - 1:2,WRITTEN_BOOK:0:/warp quest2:§aStarting Hunter - "$Script$%else%" - 1:2,WRITABLE_BOOK:0:/warp quest2:§aStarting Hunter - "$Script$%showall%" - 1:STONE:0:/showall:§aShow whatever the condition is
In Dynamic IconMenu's the scripts works when created (command called), but aren't going to update dynamically (a.k.a without closing and reopening the GUI).
A workaround to make something similar can be creating something like this (But still close and re-open the GUI):
- "$Script$%if%$PlayerData%test123%==true" - 10:STONE:0:%openiconmenu%/mycmd-playerdata set $player test123 false;/mymenu:§cGO to false - "$Script$%else%" - 10:COBBLESTONE:0:%openiconmenu%/mycmd-playerdata set $player test123 true;/mymenu:§aGO to true
In the example above, we run 2 commands directly from the GUI, the first one set a value to something, the second one reopen the same gui, to allow the updated scripts to kick-in.
P.S. The line "$Script$%showall%" make possible to show other results after an IF, without creating an useless if just to do that.
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'
#Or in 5.6.6+
- '%stayopen%/say $playerhead:&b&lHead of $playerhead:&aPress here to run;&athe command >; ;/say $playerhead'
Misc : Use $RUN_CONSOLE$ as a prefix of the command, to run it as console sender.
ANVIL GUI
Open up an Anvil graphical interface, that's allow you to execute commands and retrieve the text you type-in.
anvil_gui: command: /anvil_gui type: ANVIL_GUI anvil_title: '&eMyCommand &6ANVIL' anvil_slot_text: write here anvil_left_item: "BOOK:2:true:Write Here your lore;Line 2" anvil_commands: - $text$ $player, you typed $output - /broadcast $output - '%openiconmenu%/iconmenu $output'
anvil_left_item FORMAT : "ITEM_NAME:AMOUNT:true:LORE;MORE LORE"
> ITEM_NAME : AMOUNT : ENCHANTED TRUE OR FALSE : LORE's
To open-up an ANVIL GUI from one ICONMENU use the %openiconmenu% prefix and viceversa, from ANVIL to ICONMENU.
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
5.6.6+
How to Run commands from the Merchant GUI.
Put your commands after the "<commands>" separator. You can put multiple commands by splitting them with the ";" semicolon character.
In order to work, you need to TURN ON the LISTENER from config.yml.
- LISTENERS > INVENTORY_LISTENER: true
merchant_command_example: command: /merchantcmds type: MERCHANT merchant_title: "&3Merchant Example" merchant_items: - STONE_SWORD:1<cost>EMERALD:5<max_uses>4<commands>/command here;/command 2 here - LEVER:1<commands>$text$&bYou've just bought a &3lever!
Create a BOOK command type:
BOOK command type :
Open up a Book GUI without the need of having a book in the inventory.
Use
<br> or \n (on older plugin version)
to go to the next row in the same page. Each line is a page.
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
RAW_BOOK command type :
Create Book's with clickable text, hover textes, run commands and open links. Check the RAW_TEXT command for more info's. This use the same format of RAW_TEXT command types. Split more "interactive" parts with the < and > split section like in the example:
raw_book_test: command: /rawbook type: RAW_BOOK text: - '&aHello &b$player! &aHover your mouse over me!\n\n\n; &dMAGIC<and>Second Hover Part\n\n\n; Hover text here<and> Ecc...;ecc..' - 'TEXT\n\n;HOVER_TEXT<and>TEXT_2\n\n;Hover of text 2<and>$OPEN_URL$Go on my website\n\n;Hover part of the link;http://www.example.com<and>ecc ecc' - '&0[&d*&0]&e Click me; &eClick Here for suggest the command &d/mycmd;/mycmd' - '$RUN_COMMAND$&0[&e*&0]&c Set the time to day; &eClick for Execute;/time set day' - '$OPEN_URL$&0[&e*&0]$random_color Open Google.com; &eClick for open;http://www.google.com
You can use also :
$CHANGE_PAGE$Go to page 3;Click here to jump to page 3;3 or $COPY_TO_CLIPBOARD$
Create a SIGN_MENU command type:
ProtocolLib is required to use this feature! This feature also doesn't work on older server version such 1.8
This feature will prompt up a sign edit menu where you can retrieve the text and run commands from it.
To open up a SIGN_MENU from a ICONMENU command type, use the usual prefix "%openiconmenu%" Example : "%openiconmenu%/signmenu", Inverse way, its not necessary.
sign_menu: command: /signmenu type: SIGN_MENU sign_commands: - /say $line1 , $line2 , $line3 , $line4 - /iconmenu $line1 sign_layout: - "&f" - "^" - "type in the name" - "of the whatever"