Stock Market
StockMarket
StockMarket is a plugin designed to create a virtual and random in game Stock Market that has random events and can be a lot of fun.
You can customize the plugin so in general players will lose money, but the smart ones will come out making money. You can customize it so just about everyone is constantly making money. You can customize it so in general the stocks price stay about the same, with max and min prices so players cannot profit much from it.
Theres lots of random events and always room for more, where stocks prices are affected by certain world events or company events. The frequency of these events can be customized.
All data is stored using mySQL. Support for other DBs including flatfiles and sqlite will come later.
Plugin is currently in alpha (or whatever you want to think of it as).
Dependencies
- Vault
- Vault Compatible Economy Plugin
- MySQL Database
Commands
- /sm help <page> - Displays StockMarket help. - Permission Node: stockMarket.user.help
- /sm info - Displays plugin version & status. - Permission Node: stockMarket.user.info
- /sm list - Displays a list of stocks you are allowed to buy and their current price. - Permission Node: stockMarket.user.list
- /sm list mine - Displays a list of stocks that you currently own and their current price. - Permission Node: stockMarket.user.list
- /sm buy <stockID> <amount> - Buys the stock & amount specified. - Permission Node: stockMarket.user.buy
- /sm sell <stockID> <amount> - Sells the stock & amount specified - Permission Node: stockMarket.user.sell
- /sm add <stockID> <basePrice> <maxPrice> <minPrice> <volatility> <amount> <dividend> <stockName> - Adds a new stock to the list of all stocks. - Permission Node: stockMarket.admin.add
- /sm remove <stockID> - Removes an existing stock from the list of all stocks. Cannot be undone. - Permission Node: stockMarket.admin.remove
- /sm set <stockID> <newBasePrice> <newMaxPrice> <newMinPrice> <newVolatility> <newAmount> <newDividend> <newStockName> - Edits an existing stocks information. - Permission Node: stockMarket.admin.set
- /sm forcerandom - Forces a random event to occur on a random stock. Does nothing if no stocks exist - Permission Node: stockMarket.admin.event
- /sm reload - Reloads the plugins config. - Permission Node: stockMarket.admin.reload
- /sm <stockID> - displays more info about stock requested. - Permission Node: stockMarket.user.detail
Configuration
So right now the plugin is purely MySQL, as stated above support for other formats will be added later. Run the plugin once to generate the default config file. By default the MySQL server is localhost:3306 user: root pass: "" database: sm. If the database does not exist, it will be created. There are a few other options in there as well. :)
This plugin depends on Vault. It also requires that there be an economy plugin and a permissions plugin, else it unloads on start-up.
Adding Stocks
To add a stock use /sm add.
For example:
- /sm add MASH 100 200 1 100 -1 1 Mashlol's Epic Business of Amazingness
- /sm add AAPL 500 1000 1 25 500 2 Apple Inc.
In general:
- /sm add ID BasePrice MaxPrice MinPrice Volatility Amount Dividend (Name Can Continue For As Long As You Want)
Creating Events
#: <-- This number must follow order (i.e. don't have events 0-3 and 5-7, that would be pointless and also wouldn't work)
message: Message <-- This message will be displayed when the event occurs. All instances of %s will be replaced with the Stock ID.
effect: 50 <-- This is the base effect based on the base price. I.e. the max price change that can occur if this is 50, is an increase in the stocks price equal to 50% of the base price (that is of course if the volatility of the stock is 100)
up: true <-- Does this event increase the price or decrease it? True for increase, false for decrease.
frequency: 50 <-- This has a chance of 50/(sum of all frequencies) to be selected. For example if there are 3 events, each with a frequency of 1, they each have a 1/3 chance of occuring.
Default Config
# How many stocks is the player allowed in total?
max-total-stocks-per-player: 250
# How many stocks is the player allowed of each stock?
max-total-stocks-per-player-per-stock: 50
# How often in minutes should random events occur?
random-event-frequency: 60
# How often in minutes should dividends be paid out?
dividend-frequency: 1440
# Should offline players be paid during dividend payouts?
pay-offline-players: true
# Broadcast events?
broadcast-events: true
# Broadcast dividend payouts?
broadcast-payouts: true
mysql:
ip: localhost
port: 3306
username: root
password: ""
database: sm
events:
0:
message: "The CEO of %s has died of a heart attack. The replacement is looking to be a poor one."
effect: 40
up: false
frequency: 50
1:
message: "The CEO of %s has died of a heart attack. The replacement looks like he is even better than his successor!"
effect: 40
up: true
frequency: 50
2:
message: "%s has announced a new product to be released! Speculation is high!"
effect: 8
up: true
frequency: 250
3:
message: "%s has announced a new product to be released! Speculation is high!"
effect: 8
up: false
frequency: 250
4:
message: "%s's announced product was a huge success, customers are extremely satisfied!"
effect: 45
up: true
frequency: 250
5:
message: "%s's announced product was poorly made, causing poor customer satisfaction!"
effect: 45
up: false
frequency: 250
6:
message: "%s had a bad quarter."
effect: 30
up: false
frequency: 100
7:
message: "%s had a fantastic quarter."
effect: 30
up: true
frequency: 100
8:
message: "Everyone is speculating that %s is soon to come out with an extremely amazing product!"
effect: 65
up: true
frequency: 5
9:
message: "%s is on the brink of bankruptcy."
effect: 65
up: false
frequency: 5
10:
message: "%s just invented the next best thing since sliced bread!"
effect: 400
up: true
frequency: 1
11:
message: "%s just went bankrupt."
effect: 400
up: false
frequency: 1
12:
message: "%s just announced that they are replacing their current CEO, who has a bad reputation."
effect: 25
up: true
frequency: 25
13:
message: "%s just announced that they are replacing their current CEO, who everyone loves."
effect: 25
up: false
frequency: 25
Misc
- Source: https://github.com/Mashlol/StockMarket
- Tickets: https://github.com/Mashlol/StockMarket/issues
Warning
If you decide to test this plugin, I hold no responsibility for any possible bugs. As it is in alpha, there are likely to be exploits and such which may possibly allow a player to abuse the economy. If you run a server that is based solely on economy, you might want to wait until beta or release :)
-
View User Profile
-
Send Message
Posted Jan 6, 2016I really want to use this plugin but it is not working. I have Fe Economy, Vault, and PermissionsEx.
[16:55:35] [Server thread/INFO]: [StockMarket] Enabling StockMarket v0.08 [16:55:35] [Server thread/INFO]: [StockMarket] Economy plugin detected and hooked into. [16:55:35] [Server thread/INFO]: [StockMarket] Permissions plugin detected and hooked into. [16:55:39] [Server thread/INFO]: [StockMarket] Failed to create database during initialisation. Most likely due to incorrect database settings in config file. [16:55:39] [Server thread/ERROR]: [StockMarket] Database failed to initialise! [16:55:39] [Server thread/INFO]: [StockMarket] Disabling StockMarket v0.08 [16:55:39] [Server thread/INFO]: [StockMarket] No cleanup required as event threads never started.
-
View User Profile
-
Send Message
Posted Jan 5, 2016@GeorgeDaTurtle
Hi George,
Looking into it, but it looks like your issue is caused by you running Java 7, not 8. I compile all my plugin builds with Java 8 Development Kit.
Can you test with Java 8 for me and see if you can reproduce?
I will look to re-release v.08 compiled with JDK7 in the next day or so, will post here when done.
- Drakster2012
@GeorgeDaTurtle
-
View User Profile
-
Send Message
Posted Jan 2, 2016THIS IS THE RIGHT ONE
[18:55:38] [Server thread/ERROR]: Could not load 'plugins\StockMarket.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/github/mashlol/StockMarket : Unsupported major.minor version 52.0 at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:328) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugins(CraftServer.java:288) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.craftbukkit.v1_8_R2.CraftServer.<init>(CraftServer.java:250) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.PlayerList.<init>(PlayerList.java:69) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.DedicatedServer.init(DedicatedServer.java:180) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:501) [craftbukkit.jar:git-Bukkit-63e28b1] at java.lang.Thread.run(Unknown Source) [?:1.7.0_80-ea] Caused by: java.lang.UnsupportedClassVersionError: com/github/mashlol/StockMarket : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) [?:1.7.0_80-ea] at java.lang.ClassLoader.defineClass(Unknown Source) [?:1.7.0_80-ea] at java.security.SecureClassLoader.defineClass(Unknown Source) [?:1.7.0_80-ea] at java.net.URLClassLoader.defineClass(Unknown Source) [?:1.7.0_80-ea] at java.net.URLClassLoader.access$100(Unknown Source) [?:1.7.0_80-ea] at java.net.URLClassLoader$1.run(Unknown Source) [?:1.7.0_80-ea] at java.net.URLClassLoader$1.run(Unknown Source) [?:1.7.0_80-ea] at java.security.AccessController.doPrivileged(Native Method) [?:1.7.0_80-ea] at java.net.URLClassLoader.findClass(Unknown Source) [?:1.7.0_80-ea] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:77) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) [craftbukkit.jar:git-Bukkit-63e28b1] at java.lang.ClassLoader.loadClass(Unknown Source) [?:1.7.0_80-ea] at java.lang.ClassLoader.loadClass(Unknown Source) [?:1.7.0_80-ea] at java.lang.Class.forName0(Native Method) [?:1.7.0_80-ea] at java.lang.Class.forName(Unknown Source) [?:1.7.0_80-ea] at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:40) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) [craftbukkit.jar:git-Bukkit-63e28b1] ... 9 more [18:55:38] [Server thread/INFO]: [MultiWorld] Loading MultiWorld v5.2.6
-
View User Profile
-
Send Message
Posted Jan 2, 2016OOPS, HANG ON
-
View User Profile
-
Send Message
Posted Jan 2, 2016[10:53:43] [Server thread/INFO]: Starting minecraft server version 1.8.3 [10:53:43] [Server thread/INFO]: Loading properties [10:53:43] [Server thread/INFO]: Default game type: SURVIVAL [10:53:43] [Server thread/INFO]: Generating keypair [10:53:43] [Server thread/INFO]: Starting Minecraft server on *:25444 [10:53:43] [Server thread/INFO]: Using default channel type [10:53:43] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-63e28b1 (MC: 1.8.3) (Implementing API version 1.8.3-R0.1-SNAPSHOT) [10:53:44] [Server thread/ERROR]: Could not load 'plugins\StockMarket.jar' in folder 'plugins' org.bukkit.plugin.UnknownDependencyException: Vault at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:219) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugins(CraftServer.java:288) [craftbukkit.jar:git-Bukkit-63e28b1] at org.bukkit.craftbukkit.v1_8_R2.CraftServer.<init>(CraftServer.java:250) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.PlayerList.<init>(PlayerList.java:69) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.DedicatedServer.init(DedicatedServer.java:180) [craftbukkit.jar:git-Bukkit-63e28b1] at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:501) [craftbukkit.jar:git-Bukkit-63e28b1] at java.lang.Thread.run(Unknown Source) [?:1.7.0_80-ea] [10:53:44] [Server thread/INFO]: [MultiWorld] Loading MultiWorld v5.2.6 [10:53:44] [Server thread/INFO]: [1.8Tags] Loading 1.8Tags v1.0.0 [10:53:44] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v6.1;no_git_id [10:53:44] [Server thread/INFO]: [PermissionsEx] Loading PermissionsEx v1.23.3 [10:53:44] [Server thread/INFO]: [ServerManager] Loading ServerManager v1.0.4 [10:53:44] [Server thread/INFO]: [HolographicDisplays] Loading HolographicDisplays v2.1.10 [10:53:44] [Server thread/INFO]: [WorldGuard] Loading WorldGuard v6.1 [10:53:44] [Server thread/INFO]: [Essentials] Loading Essentials vTeamCity [10:53:44] [Server thread/INFO]: [EssentialsChat] Loading EssentialsChat vTeamCity [10:53:44] [Server thread/INFO]: [EssentialsSpawn] Loading EssentialsSpawn vTeamCity [10:53:44] [Server thread/INFO]: Preparing level "world" [10:53:44] [Server thread/INFO]: Preparing start region for level 0 (Seed: -3124478441622482492) [10:53:45] [Server thread/INFO]: Preparing spawn area: 99% [10:53:45] [Server thread/INFO]: Preparing start region for level 1 (Seed: -3124478441622482492) [10:53:46] [Server thread/INFO]: Preparing start region for level 2 (Seed: -3124478441622482492) [10:53:46] [Server thread/INFO]: [MultiWorld] Enabling MultiWorld v5.2.6 [10:53:46] [Server thread/INFO]: Preparing start region for level 3 (Seed: -7077822206511277140) [10:53:47] [Server thread/INFO]: [MultiWorld] v5.2.6 enabled. [10:53:47] [Server thread/INFO]: [1.8Tags] Enabling 1.8Tags v1.0.0 [10:53:47] [Server thread/WARN]: [1.8Tags] PermissionsEX cannot be found! Please disable "NameTags.UseSystem.PermissionsEX" [10:53:47] [Server thread/INFO]: *** 1.8 Tags *** [10:53:47] [Server thread/INFO]: 1.8 Tags Loaded Succefuly [10:53:47] [Server thread/INFO]: (c) PlayerForceHD [10:53:47] [Server thread/INFO]: All Rights Reserved [10:53:47] [Server thread/INFO]: *** 1.8 Tags *** [10:53:47] [Server thread/INFO]: [WorldEdit] Enabling WorldEdit v6.1;no_git_id [10:53:47] [Server thread/INFO]: WEPIF: Using the Bukkit Permissions API. [10:53:47] [Server thread/INFO]: [WorldEdit] Using com.sk89q.worldedit.bukkit.adapter.impl.Spigot_v1_8_R2 as the Bukkit adapter [10:53:47] [Server thread/INFO]: [PermissionsEx] Enabling PermissionsEx v1.23.3 [10:53:47] [Server thread/INFO]: [PermissionsEx] Initializing file backend [10:53:47] [Server thread/INFO]: [PermissionsEx] Permissions file successfully reloaded [10:53:47] [Server thread/INFO]: WEPIF: PermissionsEx detected! Using PermissionsEx for permissions. [10:53:47] [Server thread/INFO]: [ServerManager] Enabling ServerManager v1.0.4 [10:53:47] [Server thread/INFO]: [HolographicDisplays] Enabling HolographicDisplays v2.1.10 [10:53:47] [Server thread/WARN]: [HolographicDisplays] Hologram 'spawntag' was in the world 'Spawn' but it wasn't loaded. [10:53:47] [Server thread/INFO]: [WorldGuard] Enabling WorldGuard v6.1 [10:53:48] [Server thread/INFO]: [WorldGuard] (world) TNT ignition is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world) Lighters are PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world) Lava fire is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world) Fire spread is UNRESTRICTED. [10:53:48] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world' [10:53:48] [Server thread/INFO]: [WorldGuard] (world_nether) TNT ignition is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world_nether) Lighters are PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world_nether) Lava fire is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world_nether) Fire spread is UNRESTRICTED. [10:53:48] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_nether' [10:53:48] [Server thread/INFO]: [WorldGuard] (world_the_end) TNT ignition is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world_the_end) Lighters are PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world_the_end) Lava fire is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (world_the_end) Fire spread is UNRESTRICTED. [10:53:48] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_the_end' [10:53:48] [Server thread/INFO]: [WorldGuard] (creative) TNT ignition is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (creative) Lighters are PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (creative) Lava fire is PERMITTED. [10:53:48] [Server thread/INFO]: [WorldGuard] (creative) Fire spread is UNRESTRICTED. [10:53:48] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'creative' [10:53:48] [Server thread/INFO]: [WorldGuard] Loading region data... [10:53:48] [Server thread/INFO]: [Essentials] Enabling Essentials vTeamCity [10:53:48] [Server thread/INFO]: Bukkit version format changed. Version not checked. [10:53:48] [Server thread/INFO]: git-Bukkit-63e28b1 (MC: 1.8.3) [10:53:48] [Server thread/INFO]: 1.8.3-R0.1-SNAPSHOT [10:53:48] [Server thread/INFO]: Using locale en_AU [10:53:48] [Server thread/INFO]: Using locale en_AU [10:53:48] [Server thread/INFO]: Essentials: Using PermissionsEx based permissions. [10:53:48] [Server thread/INFO]: [EssentialsChat] Enabling EssentialsChat vTeamCity [10:53:48] [Server thread/INFO]: [EssentialsSpawn] Enabling EssentialsSpawn vTeamCity [10:53:48] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it [10:53:48] [Server thread/INFO]: Done (4.386s)! For help, type "help" or "?"
-
View User Profile
-
Send Message
Posted Jan 2, 2016@GeorgeDaTurtle
Hi There,
I'll test again, but I did have this running on a 1.8 bukkit server with no issues. Can you show me the error?
- Drakster2012
-
View User Profile
-
Send Message
Posted Jan 2, 2016I don't know much about how this works, I loaded the 1.8 plugin with vault an it says 'invalid plugin exception'
-
View User Profile
-
Send Message
Posted Jan 1, 2016yeah, 1.8 Please?
-
View User Profile
-
Send Message
Posted Jul 10, 2015Please update to 1.8
-
View User Profile
-
Send Message
Posted Aug 26, 2014Do you need MySQL to use this?
-
View User Profile
-
Send Message
Posted Jul 14, 2014@MineCrafterCity
I am also running a 1.7.2 server and it works just fine!
That error you are getting is because you have not setup the sql server in the config file. You need to check to see if your server has an sql server. If it does, look up your login information for the sql server in your control panel. Put the username, password, and IP into your config.yml inside the plugin folder, where it asks for it. Also the default port should work.
After that restart your server, or do "/sm reload" and enjoy the plugin! :)
(Idk if you have a server anymore, or if you are still interested in this plugin. I'm commenting so that future users can fix this problem)
-
View User Profile
-
Send Message
Posted Feb 12, 2014It gives an Internal command error when exeuting the /sm add command on 1.7.2
-
View User Profile
-
Send Message
Posted Dec 28, 2013Just tested and ran this plugin on a production 1.7.4 Bukkit server. All is good, this plugin will function properly on 1.7.4 builds. :)
-
View User Profile
-
Send Message
Posted Dec 21, 2013This plugin should be available for 1.7.2, it looks really great!
-
View User Profile
-
Send Message
Posted Nov 24, 2013Hi, just wondering if this plugin still works for 1.6.4 and 1.7.2, It seems extremely amazing, and was wondering if it works. Thanks!
-
View User Profile
-
Send Message
Posted Jul 15, 2013@KnightsOfTables
How about some kind of Towny support? Each town / nation has its stock automatically created and can be distributed by mayors / nation leaders to their residents. Residents can sell it to players and wealth can be decided on town land size, power and amount of citizens.
-
View User Profile
-
Send Message
Posted May 21, 2013Hope some one's going to update this, I see there's a source. :)
-
View User Profile
-
Send Message
Posted Apr 28, 2013I wish this was updated. I used it last year and miss it now.
-
View User Profile
-
Send Message
Posted Mar 7, 2013So is anyone going to continue this cool plugin? I see it utilized on some servers, and I love it. I think they update it themselves though, and I am not a Java guy. So if anyone is updating this, please tell me since I would love to use it.
-
View User Profile
-
Send Message
Posted Jan 31, 2013@lcpvp
It's an open source project, feel free to fork it and update it, make a pull request for new features and I'll add you to the project on bukkit dev so you can add builds and such.