Server Menu Management
Try /itemmenu edit <menu-file-name> in game!
With the help of Contributor , I find the other use of this plugin as a GUI command runner for non-coders and introduced the server menu management feature. Now, non-coders can create menus with a text editor or with a friendly UI in game, and menu options can have bind to them. All menus created this way will be stored as menu files. A menu file is an YAML file(<menu-file-name>.yml) stored in the menus folder under the plugin's data folder and it's name(without the .yml) will be used by commands.
A menu file is an YAML text file(<menu-file-name>.yml). Like the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#The title of the menu title: Test #The options options: #Option 1 #Name of the option - name: "name 1" #The lore of the option If you don't need it, don't have it lore: - "lore 1" - "lore 2" - "lore 3" #If the option is selectable selectable: true #The id of the material material: 25 #The amount of the item amount: 10 #The damage of the item, don't add this unless you have a clear idea what you're doing damage: 0 #The data of the item, don't add this unless you have a clear idea what you're doing data: 0 #The X position of the option(0~8) posX: 0 #The Y position of the option(0~5) posY: 0 #The command to be executed when the option is clicked(no "/") command: "me sent a menu to <target>" #The executor of the command above. #Can be: # <sender> The one who sent the menu # <target> The target of the menu(the one who views) # CONSOLE console # name The player name you want the command to be executed by. commandby: <sender> #Option 2 - name: "name 2" selectable: true material: 15 posX: 1 posY: 0 command: "me clicked <name>" commandby: <target> #Add more options here #If the menu can be closed normally. canclose: true #The command to be executed when the menu is closed(without any option selected) #This command is executed by the console onclose: "say <title> closed"
The commands in the menu file can have symbols to be replaced when used:
- <title>: The title of the menu
- <sender>: The name of the sender(The one issued command /menu open)
- <sender-as-op>: Use this only in commandby This means the command will be executed by the sender as an op
- <target>: The name of the target(The one viewing the menu)
- <target-as-op>: Use this only in commandby This means the command will be executed by the target as an op
- <name>: The name of the option which this command belongs
This plugin has only one command: itemmenu(Aliases: menu)
- /itemmenu open <menu-file-name> <player-name> to open the specific menu to the target player
- /itemmenu edit <menu-file-name> to open a UI to edit the specific menu file
- /itemmenu delete <menu-file-name> to delete specific menu file
- /itemmenu bind <menu-file-name> [-i] to bind the holding item to specific menu
- /itemmenu reload to reload all menu files in the disk
- /itemmenu help to print a help
- /itemmenu null for no use at all(Used in the menu for no command)
More to explore
Want multiple commands for one option? Want delayed commands? Use CommandPackage! Package commands together!