Skip to content

Configuration

Mrcomputer1 edited this page Dec 10, 2025 · 18 revisions

config.yml

This is the main configuration file of the plugin.

# Smiley Player Trader Configuration
# Configuration Documentation: https://github.com/Mrcomputer1/SmileyPlayerTrader/wiki/Configuration

# Configures worlds that players can or can't trade in.
allowedWorlds:
  # Either blacklist (players must not be in this world to trade) or whitelist (players must be in this to trade).
  mode: blacklist
  # List of worlds.
  worlds: []

# A list of sources for products
stockLocations:
  - inventory
  - enderchest
  - itemstorage # Requires item storage to be enabled, otherwise ignored.
#  - shulkerbox # Take items from Shulker Boxes in inventory. Doesn't receive earnings.
#  - shulkerbox_enderchest # Take items from Shulker Boxes in ender chests. Doesn't receive earnings.

# Require that the stock be retrieved from only one location, and not spread out across many locations.
useOnlyOneStockLocation: false

# Automatically thank a player for a purchase
autoThanks:
  # Supported modes are:
  # - player_chat: Send a message as the player in chat.
  # -     * may break on some versions of Paper, if the message contains colour or other formatting.
  # -     * does not work while the store player is offline.
  # - system_chat: Send a server message.
  # -     * works while the store player is offline.
  # - none: Disable autoThanks.
  mode: system_chat
  # Choose the message to send.
  # - Use "default" for the default message.
  # - Or, specify your own message, with colour codes accepted (example: &a for green).
  # Custom message replacements:
  # - %CUSTOMER% - The player that made the purchased.
  # - %MERCHANT% - The player that was purchased from.
  # Default messages are these:
  # - player_chat: "&aThanks for your purchase, %CUSTOMER%"
  # - system_chat: "&a[%MERCHANT%]: Thanks for your purchase, %CUSTOMER%"
  message: "default"
  # Choose who to send the message to.
  # Options are:
  # - everyone: All online players.
  # - customer: Only send to the customer.
  # - merchant: Only send to the merchant.
  # - involved: Only send to the people involved in the transaction (the customer and the merchant).
  # The following modes do not support the target option and will always use the specified default value:
  # - player_chat: "everyone".
  target: everyone

# Selected language (see the languages folder for a list of languages (or make your own inside that folder))
currentLanguage: en_us

# Database
database:
  type: sqlite # Database Type (supported values are "sqlite" and "mysql")
  file: database.db # Name of database file (sqlite only)
  prefix: spt # _ is not added by default (sqlite and mysql) - do not change once set
#  host: localhost # Host of database (mysql only)
#  port: 3306 # Port number of database (mysql only)
#  name: sptdatabase # Name of database (mysql only)
#  username: root # Username of database user (mysql only)
#  password: "" # Password of database user (mysql only)

# Check for updates
checkForUpdates: true

# Check for known bugs and warn you about them
checkForBugs:
  check: false # Checks for known bugs, and warns you about them
  disable: false # Disables the plugin automatically if a possibly bad bug (such as a duplication bug) is found

# Enables/Disables the GUI Manager
useGuiManager: true

# If true, you will not be able to trade with players by right-clicking them, you will only be able to use /spt trade.
disableRightClickTrading: false

# Configure item storage, used for offline trading.
itemStorage:
  enable: false # Enables storing product items and earnings in the product for offline trading.
  productStorageLimit: -1 # Limits amount of an item that can be stored. -1 to disable.
  notifyUncollectedEarningsOnLogin: true # Displays a notification when a player joins with uncollected earnings.

# Configure behaviour of out of stock items. Invalid options are treated as showByDefault.
# Supported options are:
# showByDefault - Show as out of stock, but let the player toggle this.
# hideByDefault - Hide when out of stock, but let the player toggle this.
# show: Always show as out of stock.
# hide: Always hide when out of stock.
outOfStockBehaviour: showByDefault

# Configures if earnings are given for an item with the admin option unlimited supply enabled.
doesUnlimitedSupplyEarn: true

# When using the "/spt create" command, require the item be in the player's hand.
requireItemInHandWhileUsingCreateCommand: false

# Configures how the cost items are compared when purchasing.
# Supported options are:
# strict - The cost item must match the item provided by the player exactly.
# vanilla - Item data is ignored on the item provided by the player when the cost item has no item data. This matches vanilla's trading behaviour.
purchaseCostComparison: strict

# Configures if a notification is sent to the server when a player creates a new trade.
# - "false" indicates no message should be sent.
# - "default" indicates the default message should be sent ("&a%MERCHANT% is now selling %ITEM_TYPE%.")
# - Any other value indicates a custom message to be sent. You can use colour codes and these replacements:
# -   * %MERCHANT% - The name of the player with the trade.
# -   * %ITEM_TYPE% - The type of the item the player is selling.
# -   * %ITEM_NAME% - The name of the item the player is selling.
sendNotificationOnNewTrade: "false"

# Commands that are executed as the server when a player trades.
# Supported replacements are these:
#   * %MERCHANT%: The name of the player with the trade.
#   * %CUSTOMER%: The name of the player that traded.
#   * %PRODUCT_TYPE%: The type of the item the player is selling.
#   * %PRODUCT_NAME%: The name of the item the player is selling, or the type if no custom name.
#   * %PRODUCT_AMOUNT%: The amount of the item that the player is selling.
#   * %COST_TYPE%: The type of the primary cost item.
#   * %COST_NAME%: The name of the primary cost item, or the type if no custom name.
#   * %COST_AMOUNT%: The amount of the primary cost item.
#   * %ONLY_IF_NO_COST2%: Makes the command only run if there is no secondary cost, replaced with nothing.
#   * %COST2_TYPE%: The type of the secondary cost item. (If no secondary cost, the command isn't executed.)
#   * %COST2_NAME%: The name of the secondary cost item, or the type if no custom name. (If no secondary cost, the command isn't executed.)
#   * %COST2_AMOUNT%: The amount of the secondary cost item. (If no secondary cost, the command isn't executed.)
onTradeCompleteCommands: []

# Configures if Vault is used to check permissions of offline players when attempting to trade with them.
# Disable this if you have Vault but don't have a permission plugin or the one you have doesn't support offline players.
# If disabled, the default permission value will be used instead. For "smileyplayertrader.merchant", this is "allow".
disableVaultOfflinePermissionChecking: false

# Automatically toggle off while in combat
autoCombatLock:
  enabled: true # Enables/Disables auto combat toggling
  combatLockLength: 30 # Combat lock length (in seconds)
  neverShowNotice: false # Enables/Disables the toggle notice (if this is false, the players can choose for themselves)

# Configures a cooldown period between trades
cooldown:
  enabled: false # Enable/Disables cooldown (by default, it is disabled)
  seconds: 10 # Cooldown time between trades (in seconds)

# Configure items in the quick selection on the Set Cost screen. You can have up to 6 items.
priceQuickSelection:
  - type: EMERALD
  - type: IRON_INGOT
  - type: COPPER_INGOT
  - type: GOLD_INGOT
  - type: DIAMOND
  - type: NETHERITE_INGOT

# Configure items in the extended price selector menu on the Set Cost screen.
priceSelectorMenu:
  # Configure items that should be automatically added to the "All", "Blocks" and "Items" list
  automaticAdd:
    vanilla: true
  # Automatically added vanilla items that should not be shown, defaults to /give-only and some non-survival items.
  hiddenItems:
    - BARRIER
    - COMMAND_BLOCK
    - REPEATING_COMMAND_BLOCK
    - CHAIN_COMMAND_BLOCK
    - DEBUG_STICK
    - COMMAND_BLOCK_MINECART
    - SPAWNER
    - STRUCTURE_BLOCK
    - STRUCTURE_VOID
    - DRAGON_EGG
    - KNOWLEDGE_BOOK
    - JIGSAW
    - LIGHT
    - SUSPICIOUS_STEW
    - POTION
    - SPLASH_POTION
    - LINGERING_POTION
    - TIPPED_ARROW
    - ENCHANTED_BOOK
    - WRITTEN_BOOK
    - FILLED_MAP
    - TEST_BLOCK
    - TEST_INSTANCE_BLOCK
    - "%SPAWN_EGGS%" # All spawn eggs.
  # Additional items that should be added to the main list
  extraItems: []
  # Items that should be in the featured list (by default, the same as the price quick selection)
  featuredItems:
    - type: EMERALD
    - type: IRON_INGOT
    - type: COPPER_INGOT
    - type: GOLD_INGOT
    - type: DIAMOND
    - type: NETHERITE_INGOT

allowedWorlds

Type: configuration section

Configures what worlds trading is or isn't allowed in.

mode

Type: string

Valid Options: blacklist, whitelist

If set to blacklist, worlds is treated as a list of worlds that players cannot trade in. If set to whitelist, worlds is treated as the list of worlds a player can trade in.

worlds

Type: string list

This is a list of worlds that is treated as described in allowedWorlds.mode

stockLocations

Type: string list

Valid Options: inventory, enderchest, itemstorage, shulkerbox and shulkerbox_enderchest

A list of locations where the plugin should look for the items the player is selling.

useOnlyOneStockLocation

Type: boolean

Require that the stock be retrieved from only one location, and not spread out across many locations.

autoThanks

Type: configuration section

Note: For compatibility with older versions, a boolean is also accepted.

Configures whether the plugin should and how it should send a automatic thanks message of behalf of the merchant.

mode

Type: string

Valid Options: system_chat, player_chat, none

  • System Chat: Send as a server message.
  • Player Chat: Send a message as the player.
  • None: Disable the feature.

message

Type: string

Use default for the default message or choose your own message. Colour code (&a) are supported.

target

Type: string

Valid Options: (depends on mode) everyone, customer, merchant, involved.

Configures who the message is sent to.

Note: mode: player_chat is always everyone.

Replacement Strings

  • %CUSTOMER% - The player that made the purchased.
  • %MERCHANT% - The player that was purchased from.

currentLanguage

Type: string

The name of the language you want to use. See the languages directory for a list of languages.

database

Type: configuration section

Database settings

type

Type: string

Valid Options: sqlite and mysql

The database you wish to use

file

Type:: string

Database System: SQLite only

The name of the database file. Stored in the plugin directory.

prefix

Type: string

Database System: SQLite and MySQL

Change the database table prefix. Do not change once set or all products will disappear until changed back.

host

Type: string

Database System: MySQL only

The domain/IP of the database server.

port

Type: string

Database System: MySQL only

The port of the database server.

name

Type: string

Database System: MySQL only

The name of the database.

username

Type: string

Database System: MySQL only

The username to access the database server.

password

Type: string

Database System: MySQL only

The password to access the database server.

checkForUpdates

Type: boolean

Should the plugin check for updates?

useGuiManager

Type: boolean

Enables/disables the GUI product manager.

disableRightClickTrading

Type: boolean

If true, players will not be able to trade with players by right-clicking them and only be able to use /spt trade.

itemStorage

Type: configuration section

Configures item storage, this is required for offline trading. (Item storage is required for offline trading because it is the only item stock location that works for offline players.)

enable

Type: boolean

If item storage is enabled or not.

productStorageLimit

Type: int

The maximum amount of a product that can be stored. -1 to allow unlimited.

notifyUncollectedEarningsOnLogin

Type: boolean

If a notification should be sent to the player when they join with uncollected earnings.

outOfStockBehaviour

Type: string

Valid Options: showByDefault, hideByDefault, show and hide.

  • showByDefault: Out of stock items are by default shown as out of stock in the trade list. The player can override this per-item.
  • hideByDefault: Out of stock items are by default hidden from the trade list. The player can override this per-item.
  • show: Out of stock items are always shown as out of stock in the trade list. The player cannot override this.
  • hide: Out of stock items are always hidden from the trade list. The player cannot override this.

sendNotificationOnNewTrade

Type: string

Valid Options: false, default or a custom message.

Configures if a notification is sent to the server when a player creates a new trade.

  • false indicates no message should be sent.
  • default indicates the default message should be sent (&a%MERCHANT% is now selling %ITEM_TYPE%.)
  • Any other value indicates a custom message to be sent. You can use colour codes and these replacements:
    • %MERCHANT% - The name of the player with the trade.
    • %ITEM_TYPE% - The type of the item the player is selling.
    • %ITEM_NAME% - The name of the item the player is selling.

onTradeCompleteCommands

Type: string list

A list of commands that will be executed as the console when a player completes a trade.

The following replacements are available:

  • %MERCHANT%: The name of the player with the trade.
  • %CUSTOMER%: The name of the player that traded.
  • %PRODUCT_TYPE%: The type of the item the player is selling.
  • %PRODUCT_NAME%: The name of the item the player is selling, or the type if no custom name.
  • %PRODUCT_AMOUNT%: The amount of the item that the player is selling.
  • %COST_TYPE%: The type of the primary cost item.
  • %COST_NAME%: The name of the primary cost item, or the type if no custom name.
  • %COST_AMOUNT%: The amount of the primary cost item.
  • %ONLY_IF_NO_COST2%: Makes the command only run if there is no secondary cost, replaced with nothing.- %COST2_TYPE%: The type of the secondary cost item. (If no secondary cost, the command isn't executed.)
  • %COST2_NAME%: The name of the secondary cost item, or the type if no custom name. (If no secondary cost, the command isn't executed.)
  • %COST2_AMOUNT%: The amount of the secondary cost item. (If no secondary cost, the command isn't executed.)

disableVaultOfflinePermissionChecking

Type: boolean

Configures if Vault is used to check permissions of offline players when attempting to trade with them. Disable this if you have Vault but don't have a permission plugin or the one you have doesn't support offline players.

If disabled, the default permission value will be used instead. For "smileyplayertrader.merchant", this is "allow".

doesUnlimitedSupplyEarn

Type: boolean

Configures if earnings are given for an item with the admin option unlimited supply enabled.

requireItemInHandWhileUsingCreateCommand

Type: boolean

Configures if the product item must be in the player's hand to use the /spt create command.

purchaseCostComparison

Type: string

Valid Options: strict and vanilla.

Configures how the cost items are compared when purchasing.

  • strict: The cost item must match the item provided by the player exactly.
  • vanilla: Item data is ignored on the item provided by the player when the cost item has no item data. This matches vanilla's trading behaviour.\

autoCombatLock

Type: configuration section

Settings relating to the auto combat lock system.

enabled

Type: boolean

Enables/disables auto combat locking

combatLockLength

Type: int

Controls how many seconds you are locked for.

neverShowNotice

Type: boolean

Should the notice informing the player that combat locking was enabled and how to disable it early be shown? This message is only shown to the player once.

cooldown

Type: configuration section

Settings relating to trade cooldown. This is disabled by default.

enabled

Type: boolean

Enables/disables a cooldown period between trades.

seconds

Type: int

Controls how many seconds the cooldown period is. Grant the smileyplayertrader.bypasscooldown permission to players who shouldn't be subject to the cooldown period.

priceQuickSelection

Type: list of configuration sections

List of items on the price quick selection row.

type

Type: Bukkit Material Type

The type of the item.

amount

Type: Integer

The default amount of this item.

priceSelectorMenu

Type: configuration section

Configure the More Items... menu on the price quick selection row.

automaticAdd

Type: boolean

Configure items that should be automatically added to the main lists (All, Blocks, Items) of the menu.

vanilla

Type: boolean

Add vanilla items.

hiddenItems

Type: list of Bukkit Material Types

List of vanilla items that should not be automatically added to the list. %SPAWN_EGGS% will be expanded into all spawn eggs.

extraItems

Type: list of configuration sections

Additional items to add to the main lists.

type

Type: Bukkit Material Type

The type of the item.

amount

Type: Integer

The default amount of this item.

featuredItems

Type: list of configuration sections

List of items to display on the Featured tab.

type

Type: Bukkit Material Type

The type of the item.

amount

Type: Integer

The default amount of this item.

disabledWorlds

Deprecated: This option is no longer recommended. Instead, use allowedWorlds.worlds with allowedWorlds.mode set to blacklist.

Type: string list

This is a list of worlds where players cannot trade.

languages/

This folder contains all the translations for the plugin. The translation files are JSON files. They contain a key (the English version of the text contained in the code) and a value (the translated text).

NOTE: DO NOT EDIT EXISTING TRANSLATION FILES TO CUSTOMIZE THE TEXT FOR YOUR SERVER! COPY THE TRANSLATION FILE, SET IT IN THE CONFIGURATION FILE AND CHANGE THE VALUES IN THE COPY.

en_us.json

This is the English texts of the plugin. This file is not used to change the text in the program and is used as a template for custom languages or new translations.

Clone this wiki locally