CreateYourOwnMenus
Hiding scripts is no longer possible from Minecraft 1.16 due to changes in item lore formatting
As the name suggests, this plugin allows you to create your own menus. The menus are based on inventories, with each slot holding a clickable menu item. When a player clicks on a menu item, it performs all of the commands listed in the item's lore (the text underneath its name) in a similar manner to command blocks. You can design the menu in-game by selecting any item, naming it in an anvil, modifying its lore using a command, and using commands to create and open a menu for editing to place it anywhere in the inventory that you wish. You can modify your menus any time you want.
Thanks to TheMobCave for providing the video tutorial. Please like and subscribe!
The video tutorial was of CreateYourOwnMenus v0.2, so the latest version has even more features! One major change is that the /menu script command now has sub-commands. E.g. /menu script add [text] instead of /menu script [text]. As well as: insert, delete, replace, clear, show and hide.
Screenshots
See the gallery for screenshots.
User Reviews
"This looks amazing and would make my role playing server a lot easier for players so they don't have to remember a lot of commands." - Ccamm
"This looks amazing! I'm sure that we'll be able to use this in my new server project." - parrothead1337
"This plugin allow so much things :o" - TheNemesisA5
Features
- Use commands to manage all of your menus
- Use any in-game item as a menu item
- Edit menus in-game using inventories
- Open menus using commands, command blocks or other menus
- Activate any menu item simply by clicking it in an open menu
- Alternatively, activate menu items by holding in hand and right-clicking (can be used to open menus and more)
- Modify the lore of any item using commands /menu script clear and /menu script [comment/command] commands
- Add, remove, modify and share menus using their .yml files in the "plugins/CreateYourOwnMenus/menus" folder
- Optionally run the command as the player instead of console by using the /sudo command E.g. /sudo @p kill
- Show/hide menu script commands using the /menu script show and /menu script hide commands
- Delay execute of commands in a script using the /delay [ticks] menu script command
- Use {curly braces} to add dynamic arguments to commands (prompts the clicking player)
- If you have Vault installed you can use /requirecurrency to check if a player has a given amount of currency
- Translate into other languages using LanguageAPI
What it does not do
- This is not intended to include a full-fledged scripting language. It simply executes commands in series and is interrupted on failure. For more complex actions, conditions and program flow you should be using a plugin like Skript to run scripts on menu item clicks.
- It cannot run commands as a player with "elevated permissions". There is currently no safe way to do this within the Bukkit API without introducing errors, compatibility issues and/or require updates every build of Minecraft, CraftBukkit or even Bukkit. You can work around this by granting the permissions, performing the actions and then revoking them again, or by calling out to another plugin that supports this. I do not intend to add this feature until there is a safe way to achieve it.
Plugin Suggestions
This is a list of plugins that work well with CreateYourOwnMenus.
- Use the MicroJump plugin for BungeeCord /server command support for BungeeCord users
- Use the Skript plugin to open menus on player joining, or various other events, and create advanced scripts that you can run when clicking a menu item
- Use the Vault plugin to provide currency support using the /requirecurrency menu script command
Commands and Permissions
A full list of commands and permissions is available on the Commands and Permissions page.
Detailed command help is available in-game by typing /menu
Sharing
Find and share pre-created menus on our forums!
Scripting
A basic scripting guide is available on the Basic Command Scripting thread.
Other tutorials and guides are available on the forum
Security Considerations
The menu scripts always run as console. By default, this is not a problem as only operators have the ability to create menu items and modify menus, however if you give other players permissions to do this, be aware that it will also give them the ability to effectively run any command they wish as console.
Development
Sources are available on GitHub: https://github.com/XHawk87/CreateYourOwnMenus
Ideas
- Add internationalisation support
- Add a "cyom.menu.edit.[menu id]" permission to allow editing of a specific menu only
- Add "cyom.script.allow.all" permission to allow adding any command to a menu script, except those specifically denied (Default op)
- Add "cyom.script.allow.[command name]" permission to allow adding specific commands to menu scripts (child of cyom.script.allow.all)
- Add /menu script import [file] and /menu script export [file] for quickly importing or exporting the lore of a menu item to a simple text file
- Add "cyom.slot.lock.#" to lock specific inventory slots in a player's inventory and treat it as a menu
- Modify /menu grab command to place items into the same slots in a player's inventory where applicable, displacing other items, and otherwise finding any free slot
- Trigger a menu item when it is used to attack or break blocks with
- Add /use special command to allow the item to be used as a normal item (this cannot be used after a delay or prompt)
- Organise menus into folders, and accessed in the form "folder.menu"
- Store menu items in a format that is easier to edit manually, marking lines as hidden without the section symbols all over it
- Provide a faux creative mode for non-op creative players so that server owners can grant creative abilities to non-op players without introducing security risks
- Command support for tab-autocompletion
- Add escape character for {input prompts} so you can still use datatags
Bugs
- Items in locked slots are still dropped on death instead of remaining in their slots
- Items with the /consume command will only be removed if the stack size is 1
Deprecated Features
- To reduce the number of special menu item commands, the /GiveChest, /TakeChest and /CountChest commands will be removed and less complex and easier to understand Skript alternatives will be provided in their place
Help
This plugin uses Java 7
If you get the followed error on starting up the server with this plugin installed "Unsupported major.minor version 51.0". This means you are using an out of date version of Java. If you don't know how to upgrade, please contact your server hosting provider and ask them for help in upgrading to Java 7, or contact Oracle customer support. Mac OS X users require JDK 7 instead of JRE 7.
Very wide text boxes on menu items
Due to a Minecraft client formatting error, the invisible characters on the first line can cause the lore text box width to be increased despite taking up no space when there is visible text on the same line. This can be mitigated when hidden by keeping the first line empty using /menu script insert 0 &a. When commands are shown, it may become difficult to read them.
Non-op Creative Players spawning menu items without permission
Warning: A new security loop-hole has been discovered in the Minecraft server. It is possible for players with certain modified clients to create items for themselves that contain any lore that they want so long as they are in Creative Mode. This does not require operator status or permissions, only Creative Mode. If you have Non-operator creative players on your server be advised that if they use a modified client, it is possible for them to create any menu item that they want without needing permissions.
You can alleviate this somewhat by adding commands to the "blacklist-commands:" section in the config.yml. This will stop anyone but operators from using menu items with those commands on them. E.g.
blacklist-commands: - op - stop - kick - grantperms etc etc
Another option is to keep those players in Survival mode, but use other plugins to give them creative-like powers such as infinite resources, fast breaking and flight.
Ghost items appearing on clicking a menu item
If you are experiencing ghost items in 1.7.2 using this plugin, it is due to the client-side Minecraft bug (https://mojang.atlassian.net/browse/MC-41165). This only affects 1.7.2 and is fixed in 1.7.4. The bug is not dangerous as it is not a real item. Any attempts to move the item out of the inventory, place it, or fill the same slot will result in it disappearing. Since this is a client-side only bug, it is recommended that players be urged to update from 1.7.2 to 1.7.4 as soon as possible. Note: it is possible to play on CB 1.7.2 R0.1 beta using a Minecraft 1.7.4 client.
After restart, my menus all have weird characters wherever there were hidden commands or colours
This is a text-encoding issue caused by the some CraftBukkit servers attempting to read menu files in the wrong text encoding by default. You can fix this by telling Java to use UTF-8 by default for CraftBukkit.
For users of McMyAdmin, MultiCraft and other server launchers, there should be an option to specify text-encoding in your settings and switch to UTF-8. If not, you should have a way to add optional command line arguments, and follow the advice below for a startup script.
If you are using a startup script you will have something along the lines of:
java -Xmx1024m -jar CraftBukkit.jar
You need to add the following option somewhere after java and before -jar. E.g.
java -Xmx1024m -Dfile.encoding=UTF8 -jar CraftBukkit.jar
After updating CraftBukkit (build #3009+), my Skript custom commands aren't working from menu items
Changes in CraftBukkit build #3009 (1.7.2-R0.3-SNAPSHOT) have updated the Bukkit plugin command system that broke Skripts custom command handler. This prevented Skript from receiving commands that had been directly dispatched by other plugins. This issue was fixed in Skript 2.1.1+, so downloading the latest version of Skript should correct the problem.
It says @a or @w instead of the player's name
If a @a or @w target selector is the last character in a command, it is not currently replaced correctly. This will be fixed in the next dev build. In the meantime, attempt to ensure there is a non-whitespace character after the last target selector.
Every time I click an item in my inventory it activates it like it was a menu item
You may have inadvertently locked all of your inventory slots by misuse of the '*' permission node. This will grant you all permissions, including 'cyom.slot.lock.*' which is used for locking inventory slots so that they can be used as menus. The best solution for this is to stop using the '*' node and instead only grant yourself the specific extra permissions that you need. However if you insist on using the '*' node you will need to grant yourself the negative permission '-cyom.slot.lock.*' in order to prevent your slots from getting locked.
Every time I restart my server, all changes I made to my menus are undone
There is a time-related bug with previous builds of CYOM that prevent file saving. To fix this you must update to the latest dev build: http://dev.bukkit.org/bukkit-plugins/createyourownmenus/files/18-create-your-own-menus-v0-5-8-dev/
I can't use {NBT data tags} in my commands
Unfortunately, we already have a use for the {curly braces} as dynamic arguments that predate their use in Minecraft, so you can't use NBT data tags in your menu commands. However, you can get around this in a couple of ways:
Any items that you need to be given to a player with data tags can be pre-created and placed in a menu, then you can use the /menu grab command to give them to the player. Since you can grab multiple items at once, and edit the menu visually, it makes for a rather convenient way of setting up item kits on a server.
You can also use a custom scripting plugin like Skript to set up a custom command to run the commands for you. Using Skript in this way allows a great deal more flexibility for your menu scripts by adding logic, variables, persistence and program flow, and if you need help with them they have a lot of friendly people on their forums who are always happy to help.
Donations
If you'd like to contribute towards the continued development, support and maintenance of this project, please consider joining me on Patreon, and making a one-time or recurring pledge.
Support Channel
If you need help you can leave a comment below and I will get back to you as soon as I can. You can also join my IRC chatroom using the following link, but please read the tutorial first. http://webchat.esper.net/?channels=XHawk87&prompt=1
I am happy to give support, but repeatedly answering the same question that is explained in bold red on the plugin page is highly tedious. Don't be lazy, read first, then ask questions. It's the polite thing to do
@XHawk87
I didn't think the Skript could, after looking through it. it would work to create entirely separate menus (somewhat dynamic) though VariableTriggers seems more promising to me too. I haven't had a chance to test it yet because I've been away at work since my last post and will be away until next weekend.
That said, the feature you mentioned the dev build and int he last reply sound great! Especially the ability to set a target item slot and reload a specific menu. In theory, unless a larger number of items are changing at once it should not be an issue :)
I would be more than happy to test that build, however I can't guarantee any timely results, being I'm away for another week. By the way, thanks a lot for expanding on the idea!
Ok, I understand
@MinecraftersKnow
Thanks for the offer, however I am not looking to join a Minecraft server team right now.
Thank you and do you mind being a developer for my server? It will come with free Moderator also.
@MinecraftersKnow
I don't really understand what you're asking for. Variables in CYOM wouldn't make sense, it just runs commands in sequence. @p is just an alias for the name of the clicking player. There are also @t and @x, @y and @z for the name of the clicked target or coords of the clicked block when using the item in-hand.
"/gembomb @p" is the same as "/gembomb XHawk87" or whoever clicked the item. If this isn't right for the /gembomb command, then you should read the gembomb documentation or ask the author how it works. If it is something that has to be executed BY a player, then use the /sudo command E.g. /sudo @p gembomb
You can also have dynamic arguments where the clicking player is prompted to type in the right thing. E.g. /gembomb {location of gembomb} would prompt them:
Please enter location of gembomb:
Then whatever they enter is placed in the command. E.g. /gembomb 36 77 488
If you want to do more advanced scripting involving holding data in variables, performing calculations, using program flow etc, then you should really use custom commands created in Skript or other similar plugins.
Hello, great plugin I have just set up a whole thing for it. But I have this one plugin called GemBomb, and I need special variables for it. I tried /gembomb @p but that didn't work. Can you add variables or help me out here? Thx
I have a new dev build with the following new features:
I have only done basic testing, and I have limited time to test it thoroughly, however if anyone wants to help test, send me a private message to get a copy.
@Omanoctoa
I'm pretty sure you won't be able to alter CYOM menus directly using Skript, only through commands, I don't know about VariableTriggers as I haven't used it myself, but I have heard it is a good alternative.
A thought just occurred to me. Would a command to copy a single itemstack from a slot in one menu into a specified slot in another menu (overwriting existing item) also be useful? That way you could change the item type, enchants, data tags etc as well as the lore. You could manage all of the items in-game using the GUI system and not just through text files on the server.
I should be able to look into this some more tomorrow.
@XHawk87
Once we get this worked out, I'll add a post to the forum outlining how it could work, for anyone else with the same idea.
@XHawk87
Ahh that's what I had in mind. I figured /menu copy was the way to go. I have Skript already though it is not currently being used - it will be I just haven't gotten there yet. But, I'll look into VariableTriggers because it looks like exactly what I need, and I will definitely need it to create dynamic menus that allow for items to change per user. The /menu copy method will work usign the method you describe - though it would still need some way to change items within a menu without direct interaction from myself (import/export) so I'll see if VT or Skript can do that while waiting on your update (no rush).
With VariableTriggers I have lots of other things I can do anyways :D
@Omanoctoa
If there are very few different items in the menu, and few different levels of each item (or one set of items for each level?), I would recommend having a menu for each combination and then opening the correct one, but that quickly become unmanageable if there are more than that.
I made a start on extending the import command, but it will take some time to test and ensure that it works properly (amongst other work, I am very busy atm!). It does sound like a useful option where there are large numbers of permutations, and at least partially allows more dynamic menus to be created. Combined with Skript/etc and python/etc, it could allow truly dynamic menus, for the more advanced users anyway. I don't imagine it'd be easy for the average user to set up something like this, but it does at least make it possible.
There is a neat trick for creating per-user menus using the /menu copy command and creative use of the @p symbol. The idea is to create a template menu that you make copies of per user. E.g. Have this inside a menu item that the player activates
/menu copy my_template_menu my_player_menu_@p @p's Very Own Menu
It'll then swap in the player's ID wherever @p is used. I.e.
/menu copy my_template_menu my_player_menu_XHawk87 XHawk87's Very Own Menu
Then you have a new menu with all items from my_template_menu called my_player_menu_XHawk87.
Then you can open them for the player like this:
/menu open @p my_player_menu_@p
That will open their own copy of the menu.
@XHawk87
Thanks for the suggestions for Skript and VariableTriggers - I'll look into them now.
@XHawk87
Hmm I think, like you said, this is a bit beyond what CYOM was designed for, but it is just short of what I need. I was using the import command to enable per-item lore changes, and running commands with the change. A sort of level-up system - not final and for testing I've set it up using money. Basically... /requirecurrency 10000 /pex user @p remove oldperm /pex user @p add newperm /import item_with_next_menu_stage
(Check money, remove perm for level1, add perm for level2, import the level2 item lore)
Hmm...how to explain. Basically, when a player clicks on an item, I need it to import new commands (lores) from file (/import) giving it a different set of commands. This part works perfectly. The problem is the import command is not able to switch an item within the menu, only items in a my hand. What I need is the ability to import an item to the location within the menu, and switch it with the previous item. Primarily, to change that item's lore into the imported lore. In essence, the exact thing it does currently, but targeting a specific item within the menu.
On a second note (if that all made sense), any idea how I would go about creating per-user menus? Is it possible to export an entire menu to file, rather than just 1 item? If that's teh case, I could export a menu (per user) and simply update it as needed by importing/exporting it when the user changes items (using the theoretic method described above).
If you have a chance, I could explain this easier online. You can visit me at mc.endlesshorizons.co.uk - Our server and menu systems are a work in progress - currently undergoing a massive overhaul. I'm usually on around this time.
@wassapi
It isn't possible to do this using CYOM as the menus are designed to be static pages for ease of creation and editing in-game. See my previous reply below for details.
how do i make it so it shows a cooldown for example when they hover over the item in the menu it shows them the kit cooldown after they have used it?
@Omanoctoa
Unfortunately, CYOM was not designed to have dynamic menus, for ease of creation and editing in-game, and simpler editing of menu files by hand.
The lore import/export feature was designed to facilitate conversion from text files to menu items, and editing menu items using an external text editor for a greater range of available characters. I suppose it could be extended to allow editing specific menu items in an existing menu, but I am uncertain if this would cause glitchy visual errors or perhaps fail to update for a player that is currently looking at it. I'd have to look into it.
There may be some workarounds possible, using scripting plugins such as Skript or VariableTriggers, and/or server scripts (bash, python, perl etc), depending on what it is you are trying to achieve.
If there are small finite number of arrangements of the menu, it may be possible to create each one as a separate menu and open the correct one.
If there are a small number of total menus, you may be able to get away with using /menu reload to reload all menus from disk after they have been modified or new ones created by server scripts.
Alternatively, you could look at PopupMenuAPI, which is designed to allow dynamic menu systems, but is aimed at plugin developers, as an example of how the inventory API can be used to create menus, and a library for quickly creating menu systems. It can most likely do what you want, but would be challenging for a beginner.
If you let me know what it is you're trying to achieve I might be able to come up with some more specific suggestions.
Works perfectly in 1.8 and with many other plugins - flawless integration.
This is one of the best plugins I've ever used, few even come close to this level of functionality. I have one issue with though that I can not seem to get past and I really do need it. When I cick on an item in a menu, how can I change that item? If the item is in my hand I can import the information to file, no problem. But if the item is within a menu this doesn't work. Please help. Either a way to switch item lores by targeting that location within the menu, or a way to switch out items altogether (in-line import command).
If this is answered somewhere I do apologize - I've been through your entire site multiple times and been unable to find it.
@hiaiden22
A number of people have reported that the latest build still works in 1.8. Does it not work for you?
!!!PLEASE UPDATE TO 1.8!!!
@TehFrostyMUNSTA
Not using CYOM alone, you would need to use another plugin to trigger it by running the /menu open ([player]) [id] command.
This could be done using Skript:
Skript is also highly recommended for advanced menu scripting as you can run Custom Commands from a menu item. It complements CYOM very well.