Wiki

Clone wiki

Stocks / Home

Wiki

This is the Stock plugin official wiki. You can find useful information about the plugin below. You can download the plugin off of Mc-Market.org and SpigotMC.org.

Features

  • Real Stocks
  • Real-time updating information
  • Inventory GUI
  • And more

Dependencies

  • Vault
  • Citizens (optional for stockbrokers)

Config

There are 2 config files that will automatically be generated once you run the server with the plugin installed. The main configuration file is called config.yml. This is where the settings for the plugin are.

#!yaml

# Won't translate everything
# Accepted codes: bg, cs, de, en, es, fr, hu, ja, nb, nn, pl, pt, ru, sv, tr
preferred-language: en
#Set to false to disable auto-save. Only applies to flat file, MySQL saves instantly
auto-save: true
#How often to save in seconds, 900 = 15 minutes
auto-save-interval: 900
#How many player portfolios to keep in cache once they log off the server.
#Reduces the number of calls to fetch from database and is faster.
cache-max-size: 10
#If you want to transfer from mysql to yml make sure use-mysql is set to false
#If you want to transfer from yml to mysql make sure use-mysql is set to true
#If you want to transfer player saves from mysql to yml or yml to mysql, set to true
#MAKE SURE YOUR MYSQL INFO IS CORRECT
transfer-saves: false
#Set this to true if you have a MySQL Database you'd like to use for saving players
use-mysql: false
mysql-info:
  #Don't confuse this with you Minecraft server ip
  host: 127.0.0.1
  #This is the default port for MySQL, if your port is different change it here
  port: 3306
  #This is the name of your database/schema
  database: db1
  #This is the database account username
  user: user1
  #This is the database account password
  pass: password123
#These stocks will displayed when players type /stocks popular
#You can add and remove stocks as you please
#WARNING: Do not make the slot bigger than 54 or it won't be added, also don't use slot 50 this is where the close button is
popular-stocks:
  aapl:
    slot: 10
  tsla:
    slot: 12
  goog:
    slot: 14
  nflx:
    slot: 16
  dis:
    slot: 18
#Trading settings
trading-settings:
  #The max amount of money allowed in a transaction (buying and selling)
  #Default = 1 billion
  max-trade-value: 1000000000.00
  #Set to true if you don't want players to be able to trade when the stock market is closed in real life
  disable-trading-when-closed: false
  #Set to true if you don't want players to be able to trade on the weekend
  #To disable weekend trading this must be true along with disable-trading-when-closed
  disable-trading-on-weekends: false
  #Cooldown is how long players have to wait to sell shares after they bought them
  cooldown-enabled: true
  #Cooldown in minutes, stock prices refresh every 15 minutes
  cooldown: 15
  #Set to true to enabled taxes, only taxes players when they sell shares
  tax-enabled: false
  #Percentage, 0.05 = 5%, 0.1 = 10%
  tax: 0.05
  #This is to adjust stock prices to fit your server's economy
  #1.0 = original price, 0.5 = half priced, 2.0 = double the original
  stock-price-multiplier: 1.0
  #If whitelist-enabled is true the blacklist will be ignored
  #Only allow players to buy certain stocks
  whitelist-enabled: false
  #Prevent players from buying certain stocks
  blacklist-enabled: false
  #List of stocks that players are only allowed to buy, whitelist-enabled must be set to true
  whitelist: []
  #List of stocks to prevent players from buying, blacklist-enabled must be set to true
  blacklist: []
#Messages
messages:
  #Some symbols won't display correctly. You can leave this blank ('$' to '') if need be.
  money-symbol: '$'
  #Prefixes apply to all messages unless stated otherwise
  #Change to false if you don't want to use red/yellow/green prefixes
  #you can include your own prefixes in each message, just be sure to set this to false or it will have two prefixes
  enable-prefixes: true
  positive-prefix: '&a&l(!)&7'
  notice-prefix: '&e&l(!)&7'
  negative-prefix: '&c&l(!)&7'
  incorrect-shares: 'Shares must be greater than 0!'
  error-retrieving-stock: 'Error retrieving %symbol%: %error%!'
  not-enough-money: 'You do not have %money%'
  bought-shares: 'Successfully bought %shares% share(s) of %symbol% for %money%!'
  sold-shares: 'Successfully sold %shares% share(s) of %symbol% for %money%!'
  sold-all: 'Sold %stocks% stock(s) for %money%!'
  gave-shares: 'Successfully gave %player% %shares% share(s) of %symbol%!'
  # Doesn't use default prefixes
  shares-given: '&a&l[&7Stocks&a&l]&7%shares% share(s) of %symbol% have been added to your portfolio!'
  took-shares: 'Successfully took %shares% share(s) of %symbol% from %player%!'
  # Doesn't use default prefixes
  shares-taken: '&c&l[&7Stocks&c&l]&7%shares% share(s) of %symbol% have been taken from your portfolio!'
  # Doesn't use default prefixes
  update-available: '&e&l[&7Stocks&e&l]&7There is an update available!'
  check: '%symbol% is worth %money% per share!'
  not-enough-shares: 'You do not own %shares% share(s) of %symbol%!'
  # When a player executes /Stocks take but the player specified doesn't have enough shares
  taker-not-enough-shares: '%player% does not have %shares% share(s) of %symbol%!'
  no-stocks: 'Your portfolio is empty!'
  shares-changed: 'Your portfolio changed while trying to sell all shares!'
  stockbrokers-disabled: 'Stockbrokers is disabled: Citizens plugin not found or disabled'
  stock-market-closed: 'The stock market is closed!'
  stock-not-allowed: 'That stock is not whitelisted or is blacklisted!'
  player-not-found: 'Player not found!'
  max-trade-value-exceeded: 'You cannot make a trade involving more than %money%!'
  # The max number of shares is the Java max integer value
  max-shares-exceeded: 'The max number of shares is %shares%!'
  opening-sell-menu: 'Opening sell menu . . .'
  # Doesn't use default prefixes
  loaded-profile: '&a&l[&7Stocks&a&l]&7Stock profile loaded!'
  # Doesn't use default prefixes
  error-loading-profile: '&c&l[&7Stocks&c&l]&7There was an error retrieving your stock profile! If this persists contact staff.'
  # Message when a player tries to sell all, but all their stocks have cooldowns
  all-stocks-have-cooldown: 'All of your stocks have cooldowns!'
  cooldown: 'You must wait: %cooldown% to sell %symbol%!'
  #If days was set to T, cooldown would be like so: 0T0h0m0s instead of 0d0h0m0s
  #Only one character allowed
  cooldown-format:
    days: 'd'
    hours: 'h'
    minutes: 'm'
    seconds: 's'
#This section is for translating the text to a different language
#None of the below can have the same values, do not include color codes
gui-text:
  company-name: "Company Name"
  price: "Price"
  shares: "Shares"
  invested: "Invested"
  value: "Value"
  open-price: "Open Price"
  close-price: "Close Price"
  high-price: "High Price"
  low-price: "Low Price"
  high-52: "52 Week High"
  low-52: "52 Week Low"
  stockbroker: "Stockbroker"
  stockbroker-buy: "Buy Stocks"
  stockbroker-portfolio: "View Portfolio"
  stockbroker-popular: "View Popular"
  close-button: "Close"
  confirm-button: "Confirm"
  cancel-button: "Cancel"
  next-page-button: "Next Page -->"
  previous-page-button: "<-- Previous Page"
  subtract-shares-button: "Subtract %shares% shares"
  add-shares-button: "Add %shares% share(s)"
  #Will be displayed as [player] - Portfolio
  portfolio: "Portfolio"
  popular-inventory-title: "Popular Stocks"
  sell-menu-title: "Sell Menu"
  buy-menu-title: "Buy Menu"
  #Used in buy and sell menus
  price-estimate: "Price estimate"

The second config file is for people without a MySQL Database, player-saves.yml. Player saves will be saved in there. If you are using a database everything will be saved in the database. ###Commands & Permissions <arg> - not required when executing command

[arg] - is required when executing command

  • /Stocks buy [symbol] [shares] - Buys specified number of shares of the specified stock
    • stocks.buy
  • /Stocks sell [symbol] [shares] - Sell specified number of shares of the specified stock
    • stocks.sell
  • /Stocks sellall - Sells all of the stocks you own
    • stocks.sell
  • /Stocks check [symbol] - Checks the current price of the specified stock
    • stocks.check
  • /Stocks portfolio <player> - Inventory GUI of the stocks you own. Shows how much you put into the stock and its current value. To check another player's portfolio you can specify the player.
    • stocks.portfolio - Your portfolio
    • stocks.portfolio.others - Checking other's portfolio
  • /Stocks give [player] [symbol] [shares] - Give a player shares of specified stock for free
    • stocks.give
  • /Stocks take [player] [symbol] [shares] - Take a player shares of specified stock without payment
    • stocks.take
  • /Stocks popular | pop - Fetches inventory GUI of popular stocks that you are able to configure
    • stocks.popular
  • /Stocks config reload | rl - reloads config
    • stocks.config
  • /StockBrokers spawn - Spawn broker at your location
    • stocks.brokers.spawn
  • /StockBrokers remove - Punch broker to be removed
    • stocks.brokers.spawn
  • Use a stockbroker
    • stocks.brokers.use
  • Get notified when there is a plugin update
    • stocks.notify ###Bugs To report a bug, please visit the issues tab on this Bitbucket page or click here ###Possible Things To Add
  • Admin commands allowing players with the permissions to edit other player's stocks - v0.2
  • Main / Popular stocks GUI - v0.2
  • Stock broker NPCs - v0.3
  • Configurable option to disable trading when stocks are closed - v0.3.1
  • Taxes - v0.4
  • Stock price multiplier - v0.4
  • Cooldowns - v0.4

You can leave ideas you may have for the plugin on the Mc-Market page in the discussion tab or here on the "issues" page and click the drop-down that says bug and switch it to proposal.

Updated