Skip to content

shops.yml

goflishMC edited this page Oct 22, 2024 · 1 revision

Shops and Menus Configuration

This page will cover all the fundamental aspects necessary for setting up Genesis shops and menus.

Dynamic Editor

  • Shops and menus can be created in the online editor here.

Manual Shop Creation

The ‘shop file’ is a file that you can create yourself. Each ‘shop file’ represents a GUI/Chest Inventory where you can place any item in any inventory spot.

Let’s begin by creating a new shop file and understanding its layout:

  1. Create a new file in your shops folder located in /plugins/genesis/shops.
  2. Name this file shop.yml.
  3. Once created, open the file using a text editor.

We need to start the file with options that apply to this GUI. Let’s use the following options to start our file, but refrain from saving it just yet:

ShopName: example-shop
DisplayName: '&aExample Shop'
Command: example:ex
signs:
  text: '[example-shop]'
  NeedPermissionToCreateSign: true
  • ShopName: The internal ID of the shop which we can reference as this shop.
  • DisplayName: The title of the in-game GUI. You can use any color or formatting here.
  • Command: Here you specify the commands players can use to open the shop. You can separate multiple commands using a colon :. If you do not want the shop to be connected with a command, simply remove the whole line. In this example, the commands are /example and /ex.
  • Sign text: This is what you would type on a sign to make it open this shop. We will not use that in this example. If you want to use this, you will have to enable this in the main config file.

Adding an Item to the Shop

For this example, let’s start by adding one stone block to the first slot of the GUI. When clicked by a player, the player will buy 1 stone for $15. (NOTE: This requires Vault)

'1':
  RewardType: item
  PriceType: money
  Price: 15
  Reward:
    -  - type: STONE
       - amount: 1
  MenuItem:
    - type: STONE
    - amount: 1
    - 'lore:&fClick here to buy this item for $%price%'
  Message: '&fYou have received %reward%!'
  InventoryLocation: 1
  ExtraPermission: ''
  • ‘1’: This is the internal shop item name. It’s used to keep your file organized. You can use any name here, as long as each shop item has a unique ID.
  • RewardType: This is the type of action that happens when the item in the inventory is clicked. For a list of all possible RewardTypes, click here.
  • PriceType: This is the type of cost for clicking the item. For a list of all possible PriceTypes, click here.
  • Price: This is the price defined by the PriceType. In this case, 15 units of money will be deducted if the player clicks on this item.
  • Reward: This defines what the player will receive when they click the item. In this example, the player receives 1 stone block. For more detailed examples, click here.
  • MenuItem: This is the item (icon) that is displayed in the GUI. Here, one stone block is displayed as the item. A lore is also defined for the item that uses a placeholder. For a list of all placeholders, click here.
  • Message: This is the message displayed to the player in chat when they click the item.
  • InventoryLocation: This defines the location of the item in the inventory. 1 places it in the first slot.
  • ExtraPermission: This is an optional permission required to click the item. In this example, it is left empty.

Finish Example Shop

Now that you have added the options in the file and defined at least one item, go ahead and save the file.

  1. Reload Genesis in-game using the /genesis reload command.
  2. Since the shop is named example-shop, you can open the shop using the following command: /shop example-shop.

If you have followed these instructions correctly, you should see the stone in your shop menu.

Clone this wiki locally