DeluxeMenus Store

Jul 27, 2020
DeluxeMenus Store
  • 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 type
    Code (Text):
    /papi ecloud download Player
    and also type,
    Code (Text):
    /papi ecloud download Vault
    then wait a few seconds, then type
    Code (Text):
    /papi reload
    This will install the Player and Vault expansions for placeholderapi (papi) on your server. Once this is done, you are ready to begin making the shop. I am going to show an example, then explain what everything does.
    Code (Text):
    menu_title: '&6Shop'
    open_command: shop
    expression: 'BukkitPlayer.hasPermission("");'
    - '&fUnknown command. Type "/help" for help.'
    size: 54
    material: STONE
    data: 1
    slot: 0
    display_name: '&7Granite'
    - '&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'
    - '[close]'
    - '[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.'
    expression: '"%player_hasitem-mat:STONE-amt:64-data:1%".equals("yes");'
    - '[close]'
    - '[message] &3Wicked&9Cube &a»&7 You do not have enough granite to sell.'
    menu_title is the title of the menu. It will show at the top of the gui (chest).
    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.
    left_click_requirement is the requirement for the user to be able to left click. First we set an expression. The expression uses javascript. We use a vault placeholder to check if their balance is higher or equal to 80 and if it isn't, we close the gui and message them saying they don't have enough money.
    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-data:DATA%. 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.
  • Loading...
  • Loading...