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
(Minecraft version 1.9.4 Help)
I was wondering what texture the menu uses as I am making a texture pack for my server already and one of my menus needs about 9 rows but the texture repeats every 6 slots while the spaces still work, the texture gets disrupted. I tried changing the generic_54 but that seems to mess up all the textures, even the inventory which all makes sense but if that's what it uses then I'll have to make it work best I can, if you could just pm me please and thanks
@Tukermine
Alternatively, if you use Vault, you have access to the /requirecurrency [amount] special menu command. This will stop the menu script with a warning if the player doesn't have the given amount of money. Just place this command on the first line of your menu script, and it will ensure that the player has this much money before giving the item or taking the money.
@Tukermine
Besides using Skript instead (usual reply) I would suggest using an extra plugin called SimpleAlias. This allows you to create alias commands that run one or many other commands when used. They can be controlled with costs, cooldowns, permissions and cancel-on-move, giving you a great amount of control bundled in a single command. It means learning new syntax, but short of using Skript it's the easiest way to accomplish this.
Basically, instead of using the Iconomy command directly, Just use the alias command to run a simple /give command, and make it cost money. SimpleAlias will automatically check money and perms, etc, and it means your Menu Items are much much neater.
im using IConomy to make a shop with menus and when it takes the money it makes the players money go into - how do i make it so it wont give them the item unless they have enough money???
@djmentalvibe
Strange, I have the opposite effect on my server. When I load a menu, the head items have the SkinURL saved in the menu .yml file, so they always appear the same, even if the player has changed their skin.
I think I may have found a bug for 1.10+. Whenever I place an item as an OP into my off-hand slot, it pops out of the slot and displays "This is not a valid menu item" in my chat. It does this with any ordinary ingame item (didn't try it with any items that had commands attached, as I don't use this plugin for much on my server). Anyway, just figured I'd bring this to your attention.
@zaid4500
There are several ways you can approach this, however you can't do it with CYOM alone. You will need either Skript or similar scripting plugin, or various other plugins that support the features you're looking for. This is a rather advanced menu, so it may require some experimentation. If you have trouble, I recommend going the Skript route, as they are likely to be able to help you a lot more than I will have time to.
I would set up two menus, one with the purchase button, and one with the teleport button. By default players have the first version of the menu open for them, so they see the purchase button and no teleport button. By opening the second menu "/menu open @p second_menu", it will appear to the player that the purchase button has disappeared and the teleport button has appeared.
You can check for diamonds in two different ways. One is using an item/diamond currency plugin (there are many on DBO) which CYOM is compatible with through Vault. You can then use the special menu command "/requirecurrency 9", to require that the player has 9 diamonds.
The other is to have Skript (or similar) handle the request by setting up a custom command: http://njol.ch/projects/skript/doc/
Look through custom commands and events, it is possible to check if a player has the diamonds, and remove them, as well as run commands. You can also post on their plugin forums, they are usually willing to help people write their own scripts, and you can request other people write them for you if you're not confident.
As for always now accessing the second menu instead of the first after it has been unlocked, you could do that with permissions. You can use the commands for your permissions managing plugin to grant them the permission for that menu, or move them to the group with that permission, however your perms plugin works.
Opening the correct menu is more tricky, as that depends on how the player opens the menu (you didn't mention?). You could Skript this, by having a custom command, checking which permissions the player has, and then running the command to open the correct menu for them.
That's all of the techniques you'd need to build this feature, actually building the menu and making it work is up to you. Good luck!
It would awesome if you could tell me a way for you could tell me how to make a button that requires the player to have set amount of diamonds and then can buy a item that teleports them to a specific place. But, before they get the item the item that they need to click will dissapear forever. And that it can only be purchased once but you have the item that can teleport you forever. If this is too much of a complicated answer please tell me.
Here is a simple step version: - player opens menu - player clicks button - button dissapears - new button appears - player has 9 diamonds subtracted from their inventory - player always has access forever to the button in the menu
THANK YOU VERY MUCH IF YOU KNOW THE ANSWER
@djmentalvibe
Is this definitely just heads that are not being saved, or is it that no new changes at all are being saved?
If it is just the heads, it is likely an issue with the version of your server not correctly supporting the serialisation of that particular type of item into YAML. You could try updating to a later server version that does support it, or report it to whichever developer makes your server in a bug report.
If it is all items, you might be using an outdated version of CYOM which has a bug that prevents file saving. Try looking through your server logs to see if you get any errors on startup or when closing the menu after you have placed the heads in it.
Hey, firstly thanks for taking the time to develop this plugin, its a life saver. Secondly i don't know if this is me being stupid but every time i make a menu and insert a player head, when the server reloads the player heads just disappear. Is there any fix for this.
To aid anyone having issues with Permission-requiring commands on menu items or in menus, I recommend SimpleAlias. It has the ability to bypass permissions and bundle commands, utilize nicknames alongside usernames, and add costs, cooldowns, delays and cancel-on-move arguments for alias commands. It works wonders with CYOM :)
@XHawk87 Works fine on 1.9.4, untested on 1.10 (Using dev version v.0.5.10)
Also, I had a thought on subdirectories... instead of using a specific command reference on an item to target a directory, can you simply allow CYOM to scan any directory within the main CreateYourOwnMenus/menus/ directory? Have the directories solely as a visual aid for server owners, and let CYOM read any subfolders indiscriminately? if that makes sense ;)
@Omanoctoa
I believe /testfor works purely for command blocks, and Bukkit doesn't have a reliable way to hook into it. Skript et al are definitely the way to go for this kind of added functionality at the moment. Scripts tend to be more readable and easier to work with than command blocks and menu items when writing more complex logic. The item lore is rather confining, it really is meant to just be a simple set of commands to run otherwise it quickly becomes unmanageable.
I just had an awesome idea... Are you able to add a hook for the /testfor command? Like, so if I were to bind /testfor to an item, it would respond the same as /requirecurrency and /requirepermission do? Unless they already respond that way (currently testing). If this could be implimented, and it shouldn't be too hard as you would simply be checking if the testfor command returns a true or false output, it would add massive potential to CYOM without having to do anything else.
Adding a trigger for testfor, would mean anyone could impliment their own custom menu triggers and usage checks.
Just an idea ;)
CYOM still works for me without issue on 1.9 Yet to find a single bug, which is a nice relief...most of our plugins have issues, this one does not.
@Mekelschemlsbek
Assuming Spigot have not broken the Bukkit API, it should still work. If not, it can be reported to them so that they can ensure backwards compatibility for older plugins.
If you want support for new features, I'll need an issue posted on Github detailing the specific new feature you want. I have little time to work on Bukkit plugins at the moment, but I am open to pull requests, so long as they maintain the same standards of coding and documentation to the rest of the project, and provide evidence of testing.
Hey, first I wanna say, awesome plugin. I've been looking at various menu plugins, and I like yours the most. I recently updated my server to 1.9, and I'm curious if you're going to add 1.9 compatibility?
@XHawk87
Cool :)
No rush, I was just wondering.
@Omanoctoa
I wasn't going to add a UUID variable, as UUIDs are not meant to be used in commands. They are rather long, and meaningless to a human user. If you really want to use it, then I recommend going through Skript and using their UUID Expression. I don't intend to add support for them in CYOM.
As for silent commands, its a tricky issue. I absolutely cannot afford to introduce any maintenance cost to CYOM, so I have to stick to using the Bukkit API in a safe manner that won't break between updates. It may be a while before I have the time to really look into it.
Any progress on a UUID variable or silent commands?
I made a rather interesting menu using CYOM last week. Once a player claims an arena, they are able to customize the portal destinations in the arena lobby via a menu, that cycles through the possible portal destinations using /menu set, with the 8 destination buttons defined and stored in another menu (purely for storage).
Folders would be soooo useful for this, but I made it work :)
If you would like to see this is action, go to the server IP I gave you in the PM, use /warp combat and go to the Custom Arenas area (it has a big sign). Use /menu open customarena1-edit (I haven't aliased the command yet) and you can play with the menu. More exciting though, if you go to Custom Arenas area to the second Lobby to your right, marked Lobby 1 (the empty frame structures) you can use the menu to actually adjust the portals to your liking. To open the lobby door, punch the chiseled stone.
I'm usually on around this time and later but if I'm not on you have the perms to use Lobby 1 and the menu command.
Cheers :)
@Omanoctoa
That sounds confusing and unintuitive. I would prefer to have the symbol make sense and be easy to get to grips with.
There are a number of problems with surrounding the text with symbols. The purpose of them isn't immediately clear like a command would be, so it'd be harder for people to understand and get to grips with. It's easy to accidentally miss out a surrounding symbol and then the line becomes meaningless. It also would not gel well the current script hiding features which are designed to be used on commands. It makes the parser more complex as currently it mainly just replaces tokens and runs commands. Finally, it means you can't use those particular symbols in the text without having an additional escape character.
I would much prefer to use a command-based solution. It can have an alias, so if length is an issue it could be as short as e.g. /m @p text