DeluxeMenus is a plugin that allows you to create chest gui's that can do almost anything. You can do things from a simple server/world selector to an extensive shop like the one I will be showing you how to make today. For this shop to work, you will need a few things. You will need the deluxemenus plugin by @clip and placeholderapi also by @clip
Once you have got those two plugins, restart your server so they are correctly working. Once you have done that, ingame typeCode (Text):/papi ecloud download PlayerCode (Text):/papi ecloud download VaultCode (Text):/papi reload
Code (Text):menu_title: '&6Shop'
- '&fUnknown command. Type "/help" for help.'
- '&7Buy Price: &a$80'
- '&7Sell Price: &c$40'
- '[console] eco take %player_name% 80'
- '[console] give %player_name% stone:1 64'
- '[message] &3Wicked&9Cube &a»&7 You have successfully purchased 64 granite.'
expression: '%vault_eco_balance% >= 80'
- '[message] &3Wicked&9Cube &a»&7 You do not have enough money to buy.'
- '[console] eco give %player_name% 40'
- '[console] clear %player_name% stone:1 64'
- '[message] &3Wicked&9Cube &a»&7 You have successfully sold 64 granite.'
- '[message] &3Wicked&9Cube &a»&7 You do not have enough granite to sell.'
open_command is the command that players will use to open the menu.
open_requirement is the requirement the player must have before being able to open the menu. Under it we have deny_commands which is the message we want to show if they don't have the requirement. Expression is the actual requirement. In my example, I've made the requirement a permission but it can be anything.
size is the size of the menu. This increments in nines. Max is 54.
items is where the actual gui starts. Below it, you will specify the item types, names etc.
'1' tells deluxemenus this is the first item to be loaded. This will also become handy in debugging later.
material is the material type. You can either use an id or item name.
data is the item data. Usually you might see an id like this, 1:1 but deluxemenus doesn't allow that. Instead of using 1:1 in material, you would set material to 1 and data to 1.
slot is the slot that you want the item to go in. For the first slot, use 0, for the second, use 1 etc.
display_name is the name of the item. You may want to use color in the display name because it will be slanted if you don't.
lore is the item lore. You can use multiple lines for this.
left_click_commands is the commands you want to execute on left click of the item. In this case, we are taking $80 from the user clicking the item. This is where placeholderapi comes in and the player expansion we installed earlier. %player_name% is a placeholder allowing us to direct commands on the user left clicking the item. Once we've taken the $80, we give them 64 granite. Then we message them saying their purchase was successful.
right_click_commands is the commands we want to execute when the user right clicks. Instead of taking $80, we give them $40 then we clear 64 granite from their inventory and then we message them.
right_click_requirement is a weency bit different from left_click_requirement. Instead of checking if they have $40, we check if they have 64 granite to sell. We do this by using another placeholder, %player_hasitem-mat:MATERIALNAME-amt:AMOUNT-dataATA%. We check if this is equal to "yes" and if it isn't we close the menu and message them they don't have enough granite to sell.
NOTE: I suggest you save the gui you've made somewhere else too before using /dm reload to put it on your server. It will sometimes reset the gui file if you've done something wrong. Also, the numbers help debugging because if something goes wrong, it will say what number didn't load correctly in console and you will know where to look to fix the issue.
I hope this guide is helpful to server owners in the future wishing to use deluxemenus for their shop.