Configuration - Historical

Applied By 7smile7: Sep 3, 2017 at 4:23 AM

Configuration
[​IMG]

This page will go over all the basics that you need to know in order to set up BossShopPro.
You can either set up everything by hand or use the helpful BossShopProConfigure tool.

How to set up shops by hand?
The 'shop file' is a file you can create yourself, Every 'shop file' is a GUI/Chest Inventory, You can place any item in any inventory spot in that GUI.

Lets start out by creating a new shop file and explaining the layout of the file.
Create a new file in your shops folder, Located at /plugins/BossShopPro/shops

Lets call this file shop.yml
When created, Open the file with a text editor.

We need to begin the file with options that apply to this GUI
Lets use the following options to begin our file with, But do not save the file just yet.
Code:
ShopName: example-shop
DisplayName: '&aExample Shop'
signs:
text: '[example-shop]'
NeedPermissionToCreateSign: true
  • ShopName is the internal name of the shop which we can reference to as this shop.
  • DisplayName is the title of the in-game GUI, You can use any color or formatting here
  • The sign text 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.
Now we are going to add an item to our shop..
For this example, Lets start by adding one stone block in the first spot of the GUI, And when clicked, you will buy the stone for $15
(NOTE: This requires Vault)

Code (Text):
  '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' is the internal shop item name, To keep your file organized, Just use the inventory location here as I did in this example.
  • RewardType is the action that happens when the item in the inventory is clicked
    • For a list of all possible RewardTypes click here
  • PriceType is the cost of clicking the item
    • For a list of all possible PriceTypes click here
  • Price is the price of the PriceType that you defined, The PriceType in our example shop is money, So 15 money will be taken if you click on this item
  • Reward is what you are rewarded with when you click the item, The RewardType in our example shop is item, So I have defined type:STONE and amount:1 as reward.
    • For more detailed examples click here
  • MenuItem is the item that is displayed in the GUI in-game, This can be anything you want.. I chose to just display one stone block as item in the GUI, I have also defined a lore to the item that uses a placeholder.
    • To see a list of all possible placeholders click here
  • Message is the message displayed in chat when this item is clicked
  • InventoryLocation is the location the item will be in the inventory, so 1 will put it in the first spot
  • ExtraPermission is the permission required to click the item, We wont be using that now.

Now that you have added the options in the file and defined at least one item.. Go ahead and save the file.
Reload bossshop in-game using the following command:
/bs reload
Now because we have called the shop 'example-shop' at ShopName, We can open the shop using the following command:
/bs example-shop
Now if you have followed these instructions, You should see the following GUI in-game:
[​IMG]

You should now have a basic understanding of how the BossShopPro 'shop files' work.
  • To see more advanced examples click here
  • To see a list of all possible RewardTypes click here
  • To see a list of all possible PriceTypes click here
  • To see a list of all possible placeholders click here
  • To see a guide on how to use conditions click here




How to set up the config.yml file?
Code (Text):
# BossShopPro
# by Felix Neubauer
# Check out following page for more information: https://www.spigotmc.org/wiki/bossshoppro-configuration
#
# BossShopPro Wiki Page:
# https://www.spigotmc.org/wiki/bossshoppro
#
# Hey!
# You got BossShopPro? Awesome.
# Believe me: Setting it up is simple.
#
# You can either set it up the classic (And boring/hard) way with editing the configuration files by hand
# OR you can edit it the Boss way: Use "BossShopProConfigure" (An awesome software which allows simple Setup with a few clicks).
# You can download BossShopProConfigure here: https://www.spigotmc.org/wiki/bossshoppro-tool
#
#
#
#
#
# EnableSigns:
# If set EnableSigns to 'false' BossShop signs will be disabled.
EnableSigns: true
#
#
# MainShop:
# That's the name of your Main Shop. Whenever someone uses '/bossshop', this Shop is opened. Other Shops can be opened via '/bossshop <shop>'.
# Also, all Shops can be opened via Sign (If Signs are enabled) or with clicking a specific Item (If you have 'GuiShopManager' installed).
MainShop: Menu
#
#
# HideItemsPlayersDoNotHavePermissionsFor:
# If enabled all Items your players do not have permissions for will be "hidden". That way you can create cool things like upgrade systems:
# Put multiple Items on the same slot and hide the ones which are not available any more. For example if you work with upgrades, hide the old upgrade and show the next one.
HideItemsPlayersDoNotHavePermissionsFor: false
#
#
# CanPlayersSellItemsWithGreaterEnchants:
# If enabled players can sell items with greater enchants than needed to a shop that allows to sell items. That might be helpful when dealing with items with bad enchants,
# but also might lead to accidently selling items below their worth.
CanPlayersSellItemsWithGreaterEnchants: false
#
#
# EnableTransactionLog:
# If enabled all Transactions will be logged in a TransactionLog file.
EnableTransactionLog: false
#
#
# SearchSubfoldersForShops:
# If enabled BossShop will search children folders of the '/shops' directory for shop files. That can be quite helpful for sorting, when dealing with a big amount of shops.
SearchSubfoldersForShops: false
#
#
# AllowUnsafeEnchantments:
# If enabled you can set up items with insane enchants like knockback level 10 or a mad cookie that burns players.
AllowUnsafeEnchantments: false
#
#
# AutoRefreshDelay:
# Shops are refreshed through following ways:
# - Static shops: shops that only contain fix and static items do not need to be refreshed
# - Shops with serverpinging: Each time the servers are checked for their playeramount and motd these shops are refreshed
# - When a player purchases something that might affect the look of the shop the shop is updated (for example when a player purchases permissions or spends money)
# - Optionally all shops are updated every x seconds: If you have advanced shops you might work with conditions like hunger and health. If you do that you might want your shops
#   to automatically update after some time in order to make sure that the shops adapt to your players circumstances in live-time.
# Here you can define the refresh-delay in ticks (20 ticks = 1 second). If you do not want the shops to auto-refresh set the value to -1.
AutoRefreshDelay: 100
#
#
# ServerPinging:
# Connects with servers and allows to use their player-count and motd in placeholders.
# You can define the pinging delay in ticks (20 ticks = 1 second).
# The list of servers to ping is consists of lines that look like following: <name>:<server ip>:<server port>
# The name is later used in the placeholders: %players:<name>% and %motd:<name>%
ServerPinging:
  Enabled: false
  Delay: 45
  List:
  - snapcraft:mc.snapcraft.net:25565
#
#
# MultiplierGroups:
# Here you can set up Price Multipliers.
# If enabled, this MultiplierGroups will be loaded and players with the right permissions will get a price decrease/increase.
# The lines of the List look like this: <Permission>:<Type>:<Multiplier>.
# <Permission>: Here you can put in whatever you want. If you want a group to have this multiplier, just give that group your permission.
# <Type>: Multiplier Type. Valid: Money, Points, Exp
# <Multiplier>: Price = old Price * Multiplier
# Players can be in multiple "MultiplierGroups" at the same time.
MultiplierGroups:
  Enabled: false
  List:
  - BossShop.PriceMultiplier.Points:points:0.75
  - BossShop.PriceMultiplier.Money:money:0.5
  - BossShop.PriceMultiplier.MoneyNegative:money:2.0
  - BossShop.PriceMultiplier.Exp:exp:0.8
#
#
# PointsPlugin:  
# Only important if you work with Points.
# Here you can enter whatever you want. BossShop will always detect the Points Plugin you are using and it will hook into it
# (If you are using one). If you use multiple Points Plugins fill in the name of the one that you want BossShop to work with.
# 'PlayerPoints'/'PP', 'CommandPoints'/'CP', 'EnjinMinecraftPlugin'/'Enjin'/'EMP', 'PointsAPI'/'PAPI'.
PointsPlugin: auto-detect

How to set up the pagelayout.yml file?
Code (Text):
# BossShopPro
# by Felix Neubauer
# Check out following page for more information: https://www.spigotmc.org/wiki/bossshoppro-configuration#
#
#
#
# ShowIfMultiplePagesOnly:
# If set to true the layout shopitems are only shown as soon as the inventory size is exceeded and multiple pages need to be created.
# If you want to display the layout shopitems in any case set this to 'false'.
ShowIfMultiplePagesOnly: true
#
#
# MaxRows:
# This is the amount of rows that a shop can have without needing a second page. '6' is the limit but you can optionally make shops smaller.
MaxRows: 6
#
#
# ReservedSlotsStart:
# Here you enter the first slot that should be reserved in case of the layout being active (When multiple pages are needed or 'ShowIfMultiplePagesOnly' is set to 'false').
# All higher slots of the same page including the given slot are reserved: Shopitems will automatically be put into the next page if they are equal or higher than the given slot.
# You can use the reserverd slots to put in static layout shopitems. In this case the last (6.) row of every page is reserved in case of needing multiple pages.
ReservedSlotsStart: 46
#
#
# items:
# Here you set up the shopitems that you want to be displayed in case of the layout being active. They are set up just like every other shopitem and can work with conditions.
# Tip: Here you can use the additional conditions flag "page" that allows you to display components depending on the current page.
# Also you can use the variable %maxpage% inside page conditions. In this example there is a 'previous' button, that is shown when the player has a page higher than 1 opened
# and there is a 'next' button, which is shown when their is an other page after the current one. Also there is a 'menu' button that is always visible as soon as the layout is active.
items:
  Previous:
    RewardType: page
    Reward: previous
    PriceType: nothing
    MenuItem:
    - type:ARROW
    - amount:0
    - name:&f&lPrevious
    - 'lore:&7Go back to the previous page.'
    Message: ''
    InventoryLocation: 46
    ExtraPermission: ''
    Condition:
    - type:page
    - over:1
  Menu:
    RewardType: shop
    Reward: menu
    PriceType: nothing
    MenuItem:
    - type:CHEST
    - name:&9&l&nMenu
    - 'lore:&7Go back to the main Menu.'
    Message: ''
    InventoryLocation: 50
    ExtraPermission: ''
  Next:
    RewardType: page
    Reward: next
    PriceType: nothing
    MenuItem:
    - type:ARROW
    - amount:0
    - name:&f&lNext
    - 'lore:&7Open the next page.'
    Message: ''
    InventoryLocation: 54
    ExtraPermission: ''
    Condition:
    - type:page
    - under:%maxpage%
 
An example shop with the default pageslayout.yml looks like following:
Code (Text):
ShopName: HugeShop
DisplayName: '&l&nPages demonstration'
signs:
  text: '[hugeshop]'
  NeedPermissionToCreateSign: true
shop:
  stone1:
    MenuItem:
    - lore:&cThis example item costs %price%
    - name:&4&lExample Item 1
    - amount:1
    - type:STONE
    RewardType: ITEM
    Reward:
    - - name:&8&l%player%'s stone
      - amount:1
      - type:STONE
    PriceType: MONEY
    Price: 1000.0
    Message: '&cYou just purchased an example item for %price%!'
    ExtraPermission: ''
    InventoryLocation: 1
  stone2:
    MenuItem:
    - lore:&cThis example item costs %price%
    - name:&4&lExample Item 2
    - amount:1
    - type:COBBLESTONE
    RewardType: ITEM
    Reward:
    - - name:&8&l%player%'s stone
      - amount:1
      - type:STONE
    PriceType: MONEY
    Price: 1000.0
    Message: '&cYou just purchased an example item for %price%!'
    ExtraPermission: ''
    InventoryLocation: 46
  stone3:
    MenuItem:
    - lore:&cThis example item costs %price%
    - name:&4&lExample Item 3
    - amount:1
    - type:SANDSTONE
    RewardType: ITEM
    Reward:
    - - name:&8&l%player%'s stone
      - amount:1
      - type:STONE
    PriceType: MONEY
    Price: 1000.0
    Message: '&cYou just purchased an example item for %price%!'
    ExtraPermission: ''
    InventoryLocation: 91
[​IMG]