ShopGUIPlus/Installation & configuration

From brc plugins wiki
Jump to: navigation, search
ShopGUIPlus Logo


Installation

  1. Purchase (thanks!) and download the plugin
  2. Stop your server, put the .jar file in your server's /plugins/ directory
  3. Start the server, plugin will generate all necessary config files
  4. Fill in config.yml and shops.yml with desired settings
  5. Restart the server
  6. Done!


Configuration

All configuration files are easy to edit. If any of them lacks a feature you wish to be added, please contact us.


Adding shops

First, open the shops.yml config file. You can find there all previously added shops. Here's an example of shop with id food:

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:
      #Has to be unique for each of items, value doesn't matter
      1: 
        #Type of sold item, valid values are item/permission/enchantment/command
        type: item
        item:
          #Material name, full list can be found here: http://wiki.brcdev.net/Materials
          material: BREAD 
          #(optional) Quantity of the item
          quantity: 32
          #(optional) Data value, for example 1 for WOOD:1 means spruce wood planks
          damage: 0 
          #(optional) Custom name
          name: "&aYummy bread"
          #(optional) Lore, can contain multiple lines
          lore: 
            - "&3<3"
        #Buy price, lower than 0 means you can't buy it, 0 mean free, higher than 0 is regular value
        buyPrice: -1
        #Same as above but sell price
        sellPrice: 25 
        #Slot in shop's inventory, counting from 0 to 53
        slot: 0
      2:
        type: item
        item:
          material: COOKED_RABBIT
          quantity: 10
          damage: 0
        buyPrice: 75.5
        sellPrice: -1
        slot: 1
      3:
        type: item
        item:
          material: APPLE
          quantity: 16
          damage: 0
          name: "&cRed apple <3"
        buyPrice: 200
        sellPrice: 50
        slot: 2
      4:
        type: item
        item:
          material: COOKIE
          quantity: 5
          damage: 0
          name: "&5Cookiez"
        buyPrice: 10.5
        sellPrice: 5.5
        slot: 3


As you can see, first of all you have to define the id of the shop (has to be unique, you will refer to it later in the main config):

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:


Now you have to set the displayed name of the shop which will be visible in the GUI:

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop"


Then you can proceed to adding new items. You need items section with the same indentation as previously added name.

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:


Now, to add an item you have to create another section with higher indentation. Name it whatever you want (only alphanumeric characters), just remember the names have to be unique for each item. Then you have to add the type of the shop item. Valid types are item, permission, enchantment or command.

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:
      #Has to be unique for each of items, value doesn't matter
      1: 
        #Type of sold item, valid values are item/permission/enchantment/command
        type: item


Next you have to add the item meta like material, quantity etc. For more information on item meta please refer to this page.

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:
      #Has to be unique for each of items, value doesn't matter
      1: 
        #Type of sold item, valid values are item/permission/enchantment/command
        type: item
        item:
          #Material name, full list can be found here: http://wiki.brcdev.net/Materials
          material: BREAD 
          #(optional) Quantity of the item
          quantity: 32
          #(optional) Data value, for example 1 for WOOD:1 means spruce wood planks
          damage: 0 
          #(optional) Custom name
          name: "&aYummy bread"
          #(optional) Lore, can contain multiple lines
          lore: 
            - "&3<3"


Finally, you can proceed to basic information like buy/sell price and GUI slot number. Setting buyPrice or sellPrice to -1 will result in unbuyable/unsellable item. Remember that slot numbers go from 0 to 53.

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:
      #Has to be unique for each of items, value doesn't matter
      1: 
        #Type of sold item, valid values are item/permission/enchantment/command
        type: item
        item:
          #Material name, full list can be found here: http://wiki.brcdev.net/Materials
          material: BREAD 
          #(optional) Quantity of the item
          quantity: 32
          #(optional) Data value, for example 1 for WOOD:1 means spruce wood planks
          damage: 0 
          #(optional) Custom name
          name: "&aYummy bread"
          #(optional) Lore, can contain multiple lines
          lore: 
            - "&3<3"
        #Buy price, lower than 0 means you can't buy it, 0 mean free, higher than 0 is regular value
        buyPrice: -1
        #Same as above but sell price
        sellPrice: 25 
        #Slot in shop's inventory, counting from 0 to 53
        slot: 0


Now you have to add the shop to the main menu, otherwise players couldn't access it. Open the config.yml and proceed to shopMenuItems section. You can see there all previously added shops.

First of all you have to create a new section with unique ID (doesn't have to be the same as shop's ID):

shopMenuItems:
  #Has to be unique, value doesn't matter
  1:

Now you have to add the item placeholder for the shop, refer to Item meta again:

shopMenuItems:
  #Has to be unique, value doesn't matter
  1: 
    item:
      #The same rules apply for material, amount, damage and lore as for goBackButton
      material: CAKE 
      amount: 1 
      damage: 0
      name: "&aFood"
      lore:
        - "&7Get some yummy food here!"

Finally you have to add the ID of the shop to be opened. In this example we set the ID to food, so that's what we're going to set there. The slot number goes from 0 to 53.

shopMenuItems:
  #Has to be unique, value doesn't matter
  1: 
    item:
      #The same rules apply for material, amount, damage and lore as for goBackButton
      material: CAKE 
      amount: 1 
      damage: 0
      name: "&aFood"
      lore:
        - "&7Get some yummy food here!"
    #Shop ID from shops.yml
    shop: "food" 
    #Slot in shops menu, counting from 0 to 53
    slot: 0


We're done with our first shop. If you have any questions or errors please contact me via PM on SpigotMC or at brcbukkit[at]gmail.com.


Adding items to shops

Now we want to add some more items to previously created shop. Let's start from what we've got at the end of the previous tutorial section.

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:
      #Has to be unique for each of items, value doesn't matter
      1: 
        #Type of sold item, valid values are item/permission/enchantment/command
        type: item
        item:
          #Material name, full list can be found here: http://wiki.brcdev.net/Materials
          material: BREAD 
          #(optional) Quantity of the item
          quantity: 32
          #(optional) Data value, for example 1 for WOOD:1 means spruce wood planks
          damage: 0 
          #(optional) Custom name
          name: "&aYummy bread"
          #(optional) Lore, can contain multiple lines
          lore: 
            - "&3<3"
        #Buy price, lower than 0 means you can't buy it, 0 mean free, higher than 0 is regular value
        buyPrice: -1
        #Same as above but sell price
        sellPrice: 25 
        #Slot in shop's inventory, counting from 0 to 53
        slot: 0


In order to add more items, you have to add more sections as section named 1 in this case. Remember all sections have to have unique names, so you can just call them 1, 2, 3, 4... etc.

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:
      #Has to be unique for each of items, value doesn't matter
      1: 
        #Type of sold item, valid values are item/permission/enchantment/command
        type: item
        item:
          #Material name, full list can be found here: http://wiki.brcdev.net/Materials
          material: BREAD 
          #(optional) Quantity of the item
          quantity: 32
          #(optional) Data value, for example 1 for WOOD:1 means spruce wood planks
          damage: 0 
          #(optional) Custom name
          name: "&aYummy bread"
          #(optional) Lore, can contain multiple lines
          lore: 
            - "&3<3"
        #Buy price, lower than 0 means you can't buy it, 0 mean free, higher than 0 is regular value
        buyPrice: -1
        #Same as above but sell price
        sellPrice: 25 
        #Slot in shop's inventory, counting from 0 to 53
        slot: 0
      2:


Then just repeat steps from the previous tutorial section, add the type, item, prices and slot number:

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop" 
    items:
      #Has to be unique for each of items, value doesn't matter
      1: 
        #Type of sold item, valid values are item/permission/enchantment/command
        type: item
        item:
          #Material name, full list can be found here: http://wiki.brcdev.net/Materials
          material: BREAD 
          #(optional) Quantity of the item
          quantity: 32
          #(optional) Data value, for example 1 for WOOD:1 means spruce wood planks
          damage: 0 
          #(optional) Custom name
          name: "&aYummy bread"
          #(optional) Lore, can contain multiple lines
          lore: 
            - "&3<3"
        #Buy price, lower than 0 means you can't buy it, 0 mean free, higher than 0 is regular value
        buyPrice: -1
        #Same as above but sell price
        sellPrice: 25 
        #Slot in shop's inventory, counting from 0 to 53
        slot: 0
      2:
        type: item
        item:
          material: COOKED_RABBIT
          quantity: 10
          damage: 0
        buyPrice: 75.5
        sellPrice: -1
        slot: 1

We're done with the second item. You can add that way up to 54 (or 53 when using the go back button) items to each shop.

Enchantments and permissions

Enchantments

To add an enchantment set the type to enchantment and set the enchantment value to a valid enchantment name and the enchantmentLevel to the desired enchantment level. Full list of enchantments

      1:
        type: enchantment
        enchantment: FORTUNE
        enchantmentLevel: 2
        item:
          material: DIAMOND_PICKAXE
          quantity: 1
          name: "&8Fortune II"
          enchantments:
            - FORTUNE:2
        buyPrice: 50
        slot: 0

Permissions

To add a permission set the type to permission and set the permission value to the desired permission node which will be given to the player who buy it.

      1:
        type: permission
        permission: "essentials.msg"
        item:
          material: STONE_PICKAXE
          quantity: 1
          name: "&8/msg permission"
          enchantments:
            - EFFICIENCY:1
            - FORTUNE:2
        buyPrice: 50
        sellPrice: 25
        slot: 0

Examples

Items

Pickaxe with custom name & Efficiency I

      1:
        type: item
        item:
          material: STONE_PICKAXE
          quantity: 1
          name: "&8Crappy Pickaxe"
          enchantments:
            - EFFICIENCY:1
        buyPrice: 50
        sellPrice: 25
        slot: 0


Firework

      1:
        type: item
        item:
          material: FIREWORK
          quantity: 32
          damage: 0
          fireworkPower: 2
          fireworkEffects:
            1:
              type: BALL_LARGE
              colors:
               - YELLOW
               - ORANGE
            2:
              type: CREEPER
              colors:
               - YELLOW
               - ORANGE
        buyPrice: 10
        sellPrice: -1
        slot: 0


Mob spawners

"mob" has to be a valid entity name. List of all entity types

Note: Remember to use valid material name corresponding to your Spigot version (SPAWNER or MOB_SPAWNER)

Pig spawner with a custom name

      1:
        type: item
        item:
          material: SPAWNER
          mob: PIG
          name: "&dPig spawner"
          quantity: 1
        buyPrice: 10
        sellPrice: -1
        slot: 0

5 blaze spawners

      2:
        type: item
        item:
          material: SPAWNER
          mob: BLAZE
          quantity: 5
        buyPrice: 10
        sellPrice: -1
        slot: 1

Enchantments

Fortune II

      1:
        type: enchantment
        enchantment: FORTUNE
        enchantmentLevel: 2
        item:
          material: DIAMOND_PICKAXE
          quantity: 1
          name: "&8Fortune II"
          enchantments:
            - FORTUNE:2
        buyPrice: 50
        slot: 0


Knockback I

      1:
        type: enchantment
        enchantment: KNOCKBACK
        enchantmentLevel: 1
        item:
          material: DIAMOND_SWORD
          quantity: 1
          name: "&6Knockback I"
        buyPrice: 1000
        slot: 1


Permissions

essentials.msg

      1:
        type: permission
        permission: "essentials.msg"
        item:
          material: STONE_PICKAXE
          quantity: 1
          name: "&8/msg permission"
          enchantments:
            - EFFICIENCY:1
            - FORTUNE:2
        buyPrice: 50
        sellPrice: 25
        slot: 0

essentials.me

      2:
        type: permission
        permission: "essentials.me"
        item:
          material: DIAMOND_PICKAXE
          quantity: 1
          name: "&aPermission to use /me"
        buyPrice: 1000
        sellPrice: 500
        slot: 1


Commands

/say Hello [player name]!

    items:
      1:
        type: command
        item:
          material: WOOL
          quantity: 32
          damage: 0
        commands: 
          - "say Hello, %PLAYER%!"
        buyPrice: 500
        slot: 0


/say Good bye [player name]! /msg [player name] See you later!

      2:
        type: command
        item:
          material: WOOL
          quantity: 32
          damage: 1
        commands: 
          - "say Good bye, %PLAYER%!"
          - "msg %PLAYER% See you later!"
        buyPrice: 100
        slot: 1


Amount selection GUI customization

You can change every part of the amount selection GUI in the config. You can change items/slots, hide buttons etc.

All necessary settings are included in the amountSelectionGUI section of config.yml:

#Elements of the buy/sell GUI
amountSelectionGUI:
  #Size of the GUI, valid values are 9, 18, 27, 36, 45 and 54
  size: 54
  #Slot of the item being bought/sold
  itemSlot: 22
  #Buttons
  buttons:
    #"Set to 1" button
    set1:
      item:
        material: STAINED_GLASS_PANE
        quantity: 1
        damage: 14
        name: "&c&lSet to 1"
      slot: 18
    #"Remove 10" button
    remove10:
      item:
        material: STAINED_GLASS_PANE
        quantity: 10
        damage: 14
        name: "&c&lRemove 10"
      slot: 19
    #"Remove 1" button
    remove1:
      item:
        material: STAINED_GLASS_PANE
        quantity: 1
        damage: 14
        name: "&c&lRemove 1"
      slot: 20
    #"Add 1" button
    add1:
      item:
        material: STAINED_GLASS_PANE
        quantity: 1
        damage: 5
        name: "&a&lAdd 1"
      slot: 24
    #"Add 10" button
    add10:
      item:
        material: STAINED_GLASS_PANE
        quantity: 10
        damage: 5
        name: "&a&lAdd 10"
      slot: 25
    #"Set to 64" button
    set64:
      item:
        material: STAINED_GLASS_PANE
        quantity: 64
        damage: 5
        name: "&c&lSet to 64"
      slot: 26
    #"Confirm" button
    confirm:
      item:
        material: STAINED_GLASS
        quantity: 1
        damage: 5
        name: "&a&lConfirm"   
      slot: 39
    #"Sell all" button
    sellAll:
      item:
        material: STAINED_GLASS
        quantity: 1
        damage: 5
        name: "&a&lSell all"      
      slot: 40
    #"Cancel" button      
    cancel:
      item:
        material: STAINED_GLASS
        quantity: 1
        damage: 14
        name: "&c&lCancel"  
      slot: 41


In order to change the button item you have to edit the appropriate entry.

Setting the slot to -1 will result in the button being hidden.


Changing sizes/buttons of shops

You can change the size of any shop as well as next/previous page/go back button slots.

Just change/add the "size" value for any shop in shops.yml:

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop (page %page%)" 
    #(Optional) Shop inventory size (valid values are 9, 18, 27, 36, 45 and 54)
    size: 45

Remember to change manually button slots for specific shops or they won't appear in the GUI.


These global settings from config.yml apply to every shop unless you change the item/slot/both for a specific shop:

buttons:
  #"Go back button"
  goBack:
    item:
      #Material name, full list can be found here: http://wiki.brcdev.net/Materials
      material: NETHER_STAR 
      #Amount of the item
      amount: 1 
      #(optional) Data value, for example 1 for WOOD:1 means spruce wood planks
      damage: 0 
      #(optional) Custom name
      name: "&cBack to categories" 
      #(optional) Lore, can contain multiple lines
      lore: 
        - "&aClick here to return to the main menu"
    #Slot in each shop's GUI
    slot: 49 
  #"Previous page" button
  previousPage:
    item:
      material: PAPER
      quantity: 1
      name: "&e&lPrevious page"
    slot: 45
  #"Next page" button
  nextPage:
    item:
      material: PAPER
      quantity: 1
      name: "&e&lNext page"
    slot: 53

You can edit them for any shop using the same entry names/indentation:

shops:
  #Shop ID, mustn't contain spaces or special characters, has to be unique, is used in "shop: "food"" in config.yml and players need permissions shopguiplus.shop.food to access it
  food:
    #Shop inventory name
    name: "&5Food Shop (page %page%)" 
    #(Optional) Shop inventory size (valid values are 9, 18, 27, 36, 45 and 54)
    size: 45
    #(Optional) Changed button types/slots
    buttons:
      goBack:
        #Slot -1 means it's hidden
        slot: 40
      previousPage:
        #You can change the item as well
        item:
          material: INK_SACK
          quantity: 1
          damage: 15
        slot: 36
      nextPage:
        slot: 44


You can edit only the item or slot or both as well.

Using per item permissions

First, you have to add the enablePerItemPermissions entry to your shop in shops.yml:

  mining:
    name: "&2Mining Shop (page %page%)"
    enablePerItemPermissions: true
    items:
      1:
        type: item
        item:
          material: STONE_PICKAXE
          quantity: 1
          name: "&8Crappy Pickaxe"
          enchantments:
            - EFFICIENCY:1
        buyPrice: 50
        sellPrice: 25
        slot: 0
      2:
        type: item
        item:
          material: DIAMOND_PICKAXE
          quantity: 5
        buyPrice: 1000
        sellPrice: 500
        slot: 1
        unstack: true
      3:
        type: item
        item:
          material: IRON_SPADE
          damage: 125
          quantity: 1
          enchantments:
            - EFFICIENCY:1
        buyPrice: 750
        sellPrice: 111.11
        slot: 2

Then you have to give your players appropriate permissions.

The format of permissions is shopguiplus.item.<shop id>.<item id>.

The item ID is this number:

    items:
      1:


For instance, permissions for these three items in shop above are shopguiplus.item.mining.1, shopguiplus.item.mining.2 and shopguiplus.item.mining.3.

You can use shopguiplus.item.<shop id>.* (eg. shopguiplus.item.mining.*) to give access to all items within particular shop (or you can just set enablePerItemPermissions to false or remove it).