Skip to content

Configuration (config.yml)

Sky Young edited this page Sep 13, 2024 · 11 revisions

config.yml

Economy Settings

Currency

currency:
  type: 'ITEM'
  name: 'Emerald(s)'
  format: '[price] [name]'

type

  • ITEM: Shops will use a specified item as the currency (default is Emerald). To change this item in-game, hold the item you want to use as your currency in your hand, then run the command /shop setcurrency
  • VAULT: Shops will use Vault as the currency/economy. This requires Vault to be installed on the server and will integrate with your existing economy plugin.
  • EXPERIENCE: Shops will use experience points as the currency.

name

This is the name of the currency that shows up on signs.

  • If you are using ITEM, you will want to change this to the type of item being used.
  • If you are using VAULT, you will want to change this to a currency symbol like $.
  • If you are using EXPERIENCE, you will want to name this Experience or something similar.

format

This is the order in which prices are displayed.

  • For example, if you are using ITEM as the currency and Emerald(s) as the name, then using the format [price] [name] would show 5 Emerald(s).
  • If you are using VAULT and have your name set to $, this would by default show 5 $, so you will need to change the format to something like [name][price] in order to show $5.

creationCost

The amount of currency a player is charged to create a shop. By default there is no cost to create a shop, so if you would like to charge a fee, you can define it here.

creationCost: 0

destructionCost

The amount of currency a player is charged to destroy a shop. By default there is no cost to destroy a shop. If you would like to require players to pay a fee to destroy their shop, you can define it here.

destructionCost: 0

teleportCost

The amount of currency a player is charged to teleport to a shop (via the GUI)

teleportCost: 0

teleportCooldown

The amount of time (in seconds) a player must wait between shop teleports

teleportCooldown: 0

returnCreationCost

Should the player be refunded the creation cost when they destroy their own shop. By default players are not refunded their cost to create the shop. If you would like to refund players the creation cost, you can set this to true. This will either drop the item on the chest location if using ITEM currency, or deposit virtual funds if using VAULT currency.

returnCreationCost: false

allowPartialSales

This allows shops to sell partial stacks for a calculated partial rate if the shop is low on stock, or if the player only has partial funds. By default only the defined amount/price is allowed for a transaction, to allow partial sales you must changes this to true

allowPartialSales: false

Because calculated partial rates might be a fraction, sometimes the partial rate needs to be rounded. In order to be consistent and fair in transactions, when rounding has to happen, the item seller gets preference.

  • The "seller" of the item being bought/sold will be given the preference and have the price being paid to them rounded up.
  • The "buyer" of the item will have the amount of items they are able to purchase rounded down, so that they do not get an extra "free item". (See examples 2 & 3 below)

Example 1

(Sell Shop) Sells 64 obsidian for 4 diamonds

  • Player only has 3 diamonds in their inventory
  • Shop has 2 stacks of obsidian for sale
  • Player attempts a purchse but does not have enough funds
  • Calculated cost 1 diamond per 16 obsidian
  • Player purchases 48 obsidian for 3 diamonds

Example 2

(Sell Shop) Sells 32 Golden Apples for 10 diamonds

  • Player has 10 diamonds in their inventory
  • Shop only has 25 Golden Apples left
  • Player attempts a purchase but the Shop does not have enough items
  • Simplified Cost Calculations:
itemsPerCurrency: 3.2
itemsBeingBought (NO ROUNDING): 22.4 # Item Seller (Shop) gets Preference, round down
itemsBeingBought (ROUND DOWN): 22
priceBeingPaid (NO ROUNDING): 6.875 # Item Seller (Shop) gets Preference, round up
priceBeingPaid (ROUND UP): 7.0
  • Player purchases 22 Golden Apples for 7 diamonds

Example 3

(Buy Shop) Buys 64 Shulker Shells for 10 diamonds

  • Player only has 57 Shulker Shells in their inventory
  • Shop has 64 diamonds left
  • Player attempts to sell their items but the Player does not have enough items
  • Simplified Cost Calculations:
itemsPerCurrency: 6.4
itemsBeingBought (NO ROUNDING): 51.2
itemsBeingBought (ROUND DOWN): 51     # Item Seller (Player) gets Preference, round down
priceBeingPaid (NO ROUNDING): 7.96875
priceBeingPaid (ROUND UP): 8          # Item Seller (Player) gets Preference, round up
  • Player sells 51 Shulker Shells for 8 diamonds

General Settings

Action Mappings

If you would like to change the way players interact with shops, you can modify the controls by changing the values inside of actionMappings.

actionMappings:
  transactWithShop: 'RIGHT_CLICK_SIGN'
  transactWithShopFullStack: 'SHIFT_RIGHT_CLICK_SIGN'
  viewShopDetails: 'LEFT_CLICK_CHEST'
  cycleShopDisplay: 'SHIFT_RIGHT_CLICK_CHEST'
  • transactWithShop: Buy/Sell an item
  • transactWithShopFullStack: Purchase (or sell) 64 items from the shop (buy/sell a full stack)
  • viewShopDetails: See the details about the shop owner, stock, and more in chat
  • cycleShopDisplay: Cycle the "display" type that appears above the shop

If you would like to disable any of these actions, just set it to NONE and players will be unable to perform that action.

Available Action Types

NONE # (disables the action)

LEFT_CLICK_SIGN
SHIFT_LEFT_CLICK_SIGN
RIGHT_CLICK_SIGN
SHIFT_RIGHT_CLICK_SIGN

LEFT_CLICK_CHEST
SHIFT_LEFT_CLICK_CHEST
RIGHT_CLICK_CHEST
SHIFT_RIGHT_CLICK_CHEST