Stats


Stats - made by Lolmewn


Latest plugin release: HerePlugin issue tracker: Here
Latest plugin beta: Here
Latest Fluid MC Stats: HereWebsite issue tracker: Here
Plugin source: HereWebsite source: Here

Note about Stats 3

Some users may have downloaded Stats 3 automatically due to a bug in Stats 2. I can totally understand if you don't want that to happen. Good thing Stats 3 automatically made backups of the old files! You can open up any MySQL editor and remove all new Stats tables and rename tables like "old_Stats_player" back to "Stats_player". Then remove config.yml and rename config_old.yml back to config.yml - this should work.
A video in which I show you how to do it:

Suggested reading: The state of Stats, Achievements and Highscores.
Follow me to stay updated on the progress of Stats 3: https://twitter.com/Lolmewn

What does this plugin do?

This plugin provides you with a server-end plugin and a website-end set of files. It writes data collected through events to a MySQL database (plugin), and reads and displays that to users (website & plugin).

How do I install this?

It's really simple! Download the plugin, and drag the jar to the 'plugins' folder of your server.
Start your server, you don't have to worry about any settings file! When you join the server (You either have to be OP or have the permission-node 'stats.config'), the automatic configurator will start. This will guide you through the configuration of the plugin from in-game!
The website is also simple to install. You can check out the forum thread for detailed instructions.
And that's all! Now you can let the plugin worry about the rest ;)
Please remember to edit your server name in server.properties, as this will be sent to the global server to track your data with

Different web-ends

Since the plugin simply writes data to a MySQL database, you too can write your own website to display this data! If you make something awesome and want to share it with the rest, just throw me a PM and I'll add it here ;)
NOTE: Please seek support for the web-ends where you downloaded it. This DBO page is mainly for the plugin (although you can also ask your Fluid MC stats questions here).
List of web-ends:

Extra functionality

Achievements

There now is a side-plugin which allows you to create Achievements. You can find it here: http://dev.bukkit.org/server-mods/lolmewnachievements/

Highscores

A new plugin allowing you to track highscores. You can find it here: http://dev.bukkit.org/server-mods/highscores/

Commands/Permissions

Don't have a permissions plugin? Click here!
CommandPermission-nodeDescription
-stats.trackAll users who have this node will have their stats tracked and uploaded.
-stats.sign.placeAllows users to place [Stats] signs.
-stats.sign.destroyAllows users to break [Stats] signs
/stats-This command shows your stats!
/stats <player>stats.view.othersThis command shows someone else's stats
/stats resetstats.reset.selfThis command resets your statistics
/stats reset <player>stats.reset.otherThis command resets <player>'s stats
/stats resetallstats.resetallThis command resets everyone's stats
/stats create <statName>stats.createCreates a new stat named <statName>. Gets saved to the player table
/stats drop <statName>stats.dropDrops the stat named <statName>. You can't drop stats generated by Stats itself. Those, you can disable in the config.
/stats add <statName> <playerName> <amount> [parameters]stats.addAdd <amount> to stat <statName> using parameters [parameters]. You can usually leave parameters blank. Parameters for all stats can be found below, under column "Variables". If you're adding to yourself, you can leave out <playerName>.
/stats set <statName> <playerName> <amount> [parameters]stats.setSame usage as /stats add, only difference is that this sets the stat to <amount> instead of adding it.

What does this plugin log?

This plugin logs all actions to a MySQL database. So, you might ask, what does it log?

StatDescriptionVariables
Block breakAll broken blocks with their DatavaluesitemId itemData breaking
Block placeAll placed blocks with their DatavaluesitemId itemData breaking
DeathAll deaths with their causescause entity(boolean, true is safest)
KillAll kills with their causestype
MoveWalking, sailing, riding a train, on the back of a pig or by horse.type (0=walk, 1=boat, 2=train, 3=pig, 4=pig in train, 5=horse)
PlaytimeTime played in seconds
ArrowsArrows shot
Xp gainedTotal XP gained
JoinsTotal times joined
Fish catchedTotal fish Caught (Yes, I know it's caught.)
Damage takenTotal damage taken
Times kickedTotal times kicked
Tools brokenTotal Tools broken
Eggs thrownTotal eggs thrown
Items craftedTotal items crafted
OmnomnomTotal times had a snack
On fireTotal times being on fire
Words saidTotal words said
Commands doneTotal commands done
VotesTotal times voted for the server (uses Votifier)
WorldchangeTotal times worlds changed
BucketfillTotal buckets filled
BucketemptyTotal buckets emptied
BedenterTotal times bed entered
ItemdropsTotal times items dropped
ItempickupsTotal times items picked up
TeleportsTotal times teleported
ShearTotal times sheared
LastjoinThe time the player joined the server last
LastleaveThe time the player left the server last
FirstjoinTime first joined the server
PVPStreakCurrent PVP streak the player is on. Resets on death
PVPTopStreakHighest gotten PVPStreak value
MoneyAmount of money you have
TradesAmount of times traded with villagers
pvpPVP Statisticskilled (ID of player) weapon

Snapshots

As of Stats v1.30 (using Beta functions), you can now enable snapshots. Set snapshots.enabled to true in the config and it will be working. Explanation of the config:

KeyDefault valueDescription
enabledtrueEnables or disables the creation of Snapshots
timeToLive1WAfter a certain amount of time, old snapshots get deleted if their name is 'auto_generated snapshot'. A list of what you can use:
  • m = Minute
  • h = Hour
  • d = Day
  • W = Week
  • M = Month
  • Y = Year
interval1DThe interval at which to take a snapshot. Note that taking snapshots is done off the main thread, and shouldn't affect performance.
previousThe timestamp at which the previous snapshot was taken. Do not change this.

Disabling certain stats

You can, as of v1.26, disable stats you want in the config. You can disable any stat, just put the statname in the list. You can find all statnames up on this page.

Signs

As of 1.15, Stats now supports signs showing statistics in-game. The layout of a sign must be the following when placing it:

SignDataType can be any Stat there is. Even custom ones provided by other plugins! Check the big table above and use the Stats' name on the sign.

SignType can be either player, global, custom or rightclick.
If you use player on line 3, the name of the player of which you want his stats to display must be on line 4.
Global will take the total amount of that specific stat.
Custom signs will ask you to say an SQL query. If you don't know what this is, you probably shouldn't use it. If the query succeeds, you are asked to say some text that will end up on line 2 and 3 of the sign. This can be 30 characters max (15 per line).
rightclick signs will display the Stat value of the last player to have rightclicked the sign.

Development builds

Development builds of this project can be acquired at the provided continuous integration server.
These builds have not been approved by the BukkitDev staff. Use them at your own risk, they may or may not work at all.
Development builds for Stats can be found at my CI, over at http://ci.centrility.nl/job/Stats/.

MCStats plugin stats

How many servers use this plugin? How many players have the benefits of this plugin?
You can see all that here: http://mcstats.org/plugin/Stats
Statistics of the global server

Stats API and dev portal

There's a small API for the plugin where you can get some data.
Here you can see how to use it.

Plugins using Stats

Achievements
Highscores
PlayGridMc
AutoRank
Configurable messages
Info board
Does your plugin hook into Stats, but is it not in the list? Send me a PM!

Support

You can find me (and possibly, when I'm around, support) in my IRC channel #Lolmewn on irc.esper.net - Chat now! You can also add me on telegram: @Lolmewn

Tutorial

Global statistics server disclaimer

You might be wondering what the global server is tracking. Here is a list of what it logs:

  • Your server name, specified in server.properties
  • Your server port, specified in server.properties
  • All queries the plugin has sent to the local MySQL server.

What would I need your server name and port for? This is to keep track of the different servers out there. There are servers where multiple servers run on one box (same IP), with the same name, the only thing different is the port it's running on. I need it to tell the difference between both servers. If you really really don't want me to get this, then set "sendStatsToGlobalServer" to false in the config. It'll make me sad though :c

Metrics

This plugin utilises Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:

  • A unique identifier
  • The server's version of Java
  • Whether the server is in offline or online mode
  • The plugin's version
  • The server's version
  • The OS version/name and architecture
  • The core count for the CPU
  • The number of players online
  • The Metrics version

If you wish to disable this feature (/me cries), you can do so by opt-ing out, which you can do in the config file under /plugins/PluginMetrics/

Auto-updater

This plugin has a built-in auto-updater, which connects to BukkitDev to check for updates. If you, for some reason, wish to disable this process, you can do so by setting 'update' to false in the plugins' settings file.

Donations

If you feel like giving something back to me, you can donate to me. All income from donations will be spent on coffee or similar.
I'm accepting donations through:

  • Bitcoins on address 1QC19kut8nuMJNAsMZ3QneKuW2a8f5QgQG
  • Dogecoins on address DKN8Lrm4KfC7Jh9M2KopjPkwcRfA7Ak3zj
  • Paypal, either via email lolmewn(at)gmail.com or via this link

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Lolmewn Lolmewn Jan 31, 2016 at 11:35 UTC - 0 likes

    @smc123: Go

    So... it actually worked? I'm surprised and happy at the same time :)

    Waiting to see what's going to become of BukkitDev. May or may not switch to a replacement if it completely dies off (which is what I presume to happen really).

  • Avatar of smc123 smc123 Jan 29, 2016 at 23:37 UTC - 0 likes

    Edit Sorry, ignore me...the latest dev #406 build (and java 8 upgrade) fixes this. Thanks.

    - Hello, I'm not sure if this is a bug or maybe just an unsupported situation. I am running Stats1.37 (yeah, im old skool!). I've tried going from 1.37>2.01>3.0.2-DEV)

    when going from 1.37>2.01 the database schema is changed and uuid conversion is attempted, but all players end up with a uuid of null.

    Then when going 2.01>3 the upgrade runs and i see this message for each player:

    [01:00:44] [Server thread/WARN]: [Stats] Couldn't find UUID for XXXxxxXXX, checking Bukkit UUIDs...
    [01:00:45] [Server thread/INFO]: [Stats] Found it! Enabling convertion for user...
    

    Then i see lots of this:

    [01:16:35] [Server thread/INFO]: Wups, something went wrong while loading stat data: money
    

    Which is ok, because we dont have money.

    Followed by:

    [01:55:15] [Server thread/INFO]: Wups, something went wrong while loading stat data: money
    [01:55:16] [Server thread/INFO]: [Stats] Renaming old tables to old_<table>...
    [01:55:16] [Server thread/INFO]: [Stats] Generating new tables...
    [01:55:17] [Server thread/INFO]: The table causing the error: Stats_damage_taken
    [01:55:17] [Server thread/ERROR]: null
    nl.lolmewn.stats.api.storage.StorageException: Something went wrong while saving the user!
    	at nl.lolmewn.stats.mysql.MySQLStorage.save(MySQLStorage.java:265) ~[Stats3.jar:?]
    	at nl.lolmewn.stats.bukkit.Stats2Converter.convertDatabase(Stats2Converter.java:216) [Stats3.jar:?]
    	at nl.lolmewn.stats.bukkit.Stats2Converter.start(Stats2Converter.java:87) [Stats3.jar:?]
    	at nl.lolmewn.stats.bukkit.Stats2Converter.<init>(Stats2Converter.java:48) [Stats3.jar:?]
    	at nl.lolmewn.stats.bukkit.BukkitMain.checkConversionNeeded(BukkitMain.java:289) [Stats3.jar:?]
    	at nl.lolmewn.stats.bukkit.BukkitMain.onEnable(BukkitMain.java:105) [Stats3.jar:?]
    	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at java.lang.Thread.run(Thread.java:745) [?:1.7.0_91]
    Caused by: java.sql.SQLException: Column count doesn't match value count at row 1
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1362) ~[2015-11-09-14-05-08-spigot-188.jar:git-Spigot-5f38d38-18fbb24]
    	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:198) ~[Stats3.jar:?]
    	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:198) ~[Stats3.jar:?]
    	at nl.lolmewn.stats.mysql.MySQLStorage.save(MySQLStorage.java:252) ~[Stats3.jar:?]
    	... 16 more
    

    Afterward when i check my .Stats_players table in the database there is only a single player has been inserted.

    Am i taking the wrong upgrade path?

    Cheers

    Last edited Jan 30, 2016 by smc123
  • Avatar of Lolmewn Lolmewn Jan 20, 2016 at 22:22 UTC - 0 likes

    @HanatakeYurii: Go

    If you're using Stats 3, yes.

    @mcsorley: Go

    There is a dev-version for AutoRank out which supports Stats 3, I believe.

  • Avatar of mcsorley mcsorley Jan 19, 2016 at 21:06 UTC - 0 likes

    (Also AutoRank. Pretty sure that hasn't updated either yet)

    It now using Stats3

  • Avatar of HanatakeYurii HanatakeYurii Jan 19, 2016 at 11:18 UTC - 0 likes

    Hi,

    Is this plugin able to store how much every item was crafted (like how much placed or destroyed)?

    Last edited Jan 19, 2016 by HanatakeYurii
  • Avatar of Lolmewn Lolmewn Jan 14, 2016 at 18:46 UTC - 0 likes

    @conflictxinside: Go

    Correct, I am moving servers. It'll be back up soon.

  • Avatar of conflictxinside conflictxinside Jan 12, 2016 at 22:33 UTC - 0 likes

    Seems the dev builds server is down again.

  • Avatar of Lolmewn Lolmewn Jan 07, 2016 at 15:07 UTC - 0 likes

    @MCTylerPVP: Go

    Correct, lol. Besides, on Bitbucket you can have anonymous issues; you don't need to have an account.

  • Avatar of MCTylerPVP MCTylerPVP Jan 07, 2016 at 13:25 UTC - 0 likes

    I really don'y want to join yet another issue tracking system (bitbucket) can you help?

    [05:20:40 INFO]: [Stats] Enabling the StorageEngine...
    [05:20:40 WARN]: Exception in thread "Thread-24" 
    [05:20:40 WARN]: java.lang.ArrayIndexOutOfBoundsException: -1
    [05:20:40 WARN]:        at java.util.ArrayList.elementData(ArrayList.java:418)
    [05:20:40 WARN]:        at java.util.ArrayList.get(ArrayList.java:431)
    [05:20:40 WARN]:        at me.mrCookieSlime.CSCoreLibPlugin.updater.Updater$UpdaterTask.connect(Updater.java:70)
    [05:20:40 WARN]:        at me.mrCookieSlime.CSCoreLibPlugin.updater.Updater$UpdaterTask.run(Updater.java:58)
    [05:20:40 WARN]:        at java.lang.Thread.run(Thread.java:745)
    [05:20:40 INFO]: [Stats] UserManager set up and ready to load/save users.
    

    EDIT: Sry, The logs kind of ran together...Wrong plugin... I fixed CSCoreLib...

    Last edited Jan 07, 2016 by MCTylerPVP

    MC Client Link-EODCraft.com- WebPage http://EODCraft.com

  • Avatar of Lolmewn Lolmewn Jan 05, 2016 at 11:33 UTC - 0 likes

    @wolax: Go

    In Stats 3, this has been renamed to "Last Join" (as well as "Last leave")

Facts

Date created
Aug 19, 2012
Categories
Last update
Sep 25, 2015
Development stage
Release
License
GNU General Public License version 3 (GPLv3)
Curse link
Stats
Downloads
226,166
Recent files

Authors

Relationships

Optional dependency
Achievements Reloaded
Highscores
Votifier