BeardStat
BeardStat is statistics tracking plugin for bukkit. It tracks a wide variety of user statistics and makes them available to your playerbase and plugins.
Recorded stats
- last Login and logout time
- Total playtime
- block placement and breaking (including sub/metadata blocks like wool, logs etc)
- Items picked up/dropped
- Damage dealt and recieved
- Kills and deaths
- Food consumed
- Sheep sheared and dyed
- TNT detonated
- Distance travelled on foot/boat/cart/horse/pig
- Items crafted
- Animals tamed
- Teleports
- Fishing
Web interface (under development)
BeardStat also comes with a web interface for stats, this allows players to view their own and friends stats on your servers website. the Web interface also includes a scoreboard system to rank players based on various statistics (playtime, creepers killed)
Commands
Stats are recorded per world, and you can blacklist worlds/gamemodes from tracking. BeardStat also has a number of commands: * /stats - access to all stats information * /played - shows a players playyime. * /laston - Returns the last time the player was on * /statpage - Allows showing a selection of player stats, useful with Bukkit's command aliasing
Dev 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.
(Please note, zips in dev builds currently contain a broken implementation of the web interface, please instead download the .jar file instead. The web interface available on the right of this page) Development builds fresh from Jenkins
Issues
BeardStat has an issue tracker on github, https://github.com/tehbeard/beardstat/issues.
For error reports please include the following: * full stacktrace of the error * plugin version (inc. build number if using one from CI) * Bukkit version * Database type used (SQLite / MySQL)
Plugin integration
BeardStat provides a rich API for plugin developers to hook into BeardStat and read / record statistics.
For Developers
BeardStat stats are identifiable by a unique Id generated from 4 sub components: * Domain * World * Category * Statistic
Domain is the primary namespace for a collection of stats, the "default" domain is used by BeardStat, I ask that you use your own unique domain for your plugin (i.e. if you make a PvP arena plugin, you could use the domain "pvparena").
World represents the world in which this stat was recorded, these are for the most part the name of the world.
Two special cases exist however. "__global__" is a reserved world name, meant for stats that do not pertain to a world. The second case is "__imported__", this is a reserved world for stats that have been imported from an older version of BeardStat before per world storage was implemented.
While not intended, you can use the world id for a unique area that is not a whole world (Going back to our pvp arena example, you could use the arena names instead, such as old_forge, broken_bow instead of a world name)
Current plugins that are known to integrate BeardStat: * BeardAch - Achievements plugin * SimpleSpleef Evolution
Metrics
BeardStat includes the plugin metrics code developed by Hidendra (author of LWC), which collects anonymous information about the plugins deployment (minecraft, server, plugin version, assumed server location at country level and database type used by BeardStat, aggregated into graph form.) More information on this system, including how to disable it can be found here
@dickwick
yeah, bukkit/minecraft doesn't really offer a way to find out valid block/item metadata via code :/ has to be manual.
@timsavage
The creative track flag might be global I think, I'll have to look into it (per world settings me thinks it's time for)
As for tracking creative events separately, I have an idea on doing that without a major schema change (And damn am I happy I added the domain field now :) )
@Tehbeard
Aww, that's what I did not wanted to hear. Got my modpack with thousands new items/blocks and it is impossible and over my powers for me to do this ID by ID :(
Hey guys! This plugin has been working great for me since January.
There's something I always meant to suggest, however, and that would be having a field in the database for the gamemode of the player. I know you have a config setting for not recording events for creative players, but I'd like to be able to record all events, and have the option to view all or only events where the gamemode was one type or another.
I wish I would have submitted this suggestion before you made the 0.6 schema changes, but I figured better late than never.
And honestly, having the world field is going to facilitate the queries I'm interested in, that is separate stats for my creative and survival worlds. But I figured I'd throw it out there for you anyhow, as you might think that's a worthwhile field to have in the db.
Thanks again! Looking forward to upgrading to 0.6 when the web API is finished.
@dickwick
It is possible, but I don't know how well it will react with mod blocks, your welcome to try the method below.
You want to add a file called metadata.txt to the BeardStat folder
The format of this is a comma seperated list, one line per item, as follows:
itemId,mask,minMeta,maxMeta
itemId : id of the item
mask : bit mask to apply to the metadata (for instance, the 8 bit is used by slabs to indicate being upside down, a mask of 7 (4+2+1) will ignore the 8 bit when recording. If unsure try 15, it will catch everything but blocks with orientation might be spread across several stats.
minMeta : minimum metadata value to worry about, should be 0
maxMeta : maximum metadata value to worry about, should be 15
This will make BeardStat record the block/item under itemname_metadata format used already for stuff like wool.
Hello, is somehow possible to enable saving stats for block IDs with different data values? For modded server, when one ID is occupied by dozen of different blocks and in stats that block is counted as one, instead of different ones.
@Lolmewn
They will be carried over as a separate world called "__imported__". BeardAch will also have the world parameter of any stat triggers default to "*" (collect all worlds)
@Tehbeard
Regarding the new data format, how does it handle the current stats? Does it set them to the default world? Does it just ignore them, and basically have two rows for the same stat (one with and one without a world)?
@Tehbeard
You do know that your SQL table was fine how it was. My WebStats project has SQL of everything you would need to get yours started.
@GodsDead
You're still able to view stats in game, and they're still exposed for other plugins to use.
As I said, the web UI will be the focus of 0.6.1. (it also shouldn't take as long as 0.5 -> 0.6 took) If you don't want to update till then that's fine.
The reason I'm releasing 0.6 without the UI is for admins to be able to test BeardStat in their environment and report back any problems.
While I can catch most of bugs inside BeardStat's code during local testing, this does not come close to covering errors that can crop up in a production environment that is so changeable (clashes with other plugins, or a config misconfiguration that cause faults in the behaviour)
So with the new 0.6, there is no php web UI to display the stats? What's the purpose of this plugin? What can you use it for apart from displaying stats? Is there a big plan for the web ui to get updated?
is it possible to add logging for custom-Items (created with RPG-Items)? It would be great!
Heads up to all
Finals are over and 0.6 will hopefully released within the next week or so.
0.6 is a significant update to BeardStat. The main change you will see is that stats are now tracked per world. Changes were also made to the API so that developers (and BeardAch) can grab stats more easily.
Stats per world and domains
For example, getting how much cobblestone a player has placed in the nether (which has lets say the worldname map_nether) can be done by a query like so: default.map_nether.blockcreate.cobblestone
To get cobblestone placement on all worlds: default.*.blockcreate.cobblestone
Matching is done via regex, so some more crazy things can be done (matching a set of worlds for example).
Stats also have a domain. This is an extra bit of information to say where a stat came from. It's meant for plugins that hook into BeardStat to use. BeardStat uses the "default" domain. A spleef plugin for example might use "spleef" as it's domain, and use categories for various spleef arenas, with stats being a players win/loss/draw stats for an arena.
Upgrade and migration
Which brings us to this point. The old storage format of BeardStat, while possible to extend for use here, would be very bad to do so, and we'd just run into problems later.
Hence in 0.6 a new storage format is used. The new one separates each element of a stat (domain,world, category,statistic, owner) to their own separate tables, and the value table joins them all together.
For those using MySQL or SQLite as storage for BeardStat, your database will automatically be migrated to the new format on starting your server, with the old table kept until you manually delete it.
For those using the flat file storage, I am sorry to say I am not migrating it to the new storage format. There are a variety of reasons; lack of use by admins, difficulty in migrating the format and the prospect of continued support for it.
In contrast, both MySQL and SQLite storage providers for 0.6 now use the same code for general operations, with the only difference being initialization and a few of the SQL commands loaded by them. This massively reduces the amount of effort needed for maintaining these two, and allows me to add fancy mechanics like running migration scripts in order.
Those using the flat file storage provider have two choices: They can use 0.6 as an excuse for a clean slate, or use the transfer data provider (details on it's use will be added to a page soon) to move over to MySQL or SQLite before upgrading to 0.6.
Web API and future versions
I know I know, there has to be a new one for 0.6 since the database is different. The web API is not going to be out with 0.6, sorry.
0.6 has been a fairly large update, and I want to get it out to you guys to use now, rather than wait on me to get an optional part finished that I haven't really got a solid plan for yet.
The web API is planned for 0.6.1, which I also plan to add human readable names for items into the database. This means that the web API will not rely on external files to get the names of items.
As an example:
The wool_15 stat in the database will have in it's name field "black wool"
blockcreate category will have "blocks placed"
TL;DR
0.6 release soon!
stats per world
Better support for plugins to add stats without interfering with one another
Storage format change
Yes it's needed, you'll thank me when people can change their usernames
MySQL/SQLite will migrate automatically
Flat file will not be 0.6, transfer to SQLite/MySQL now (page on how-to soon)
No web API/page this version sorry :(
web API in 0.6.1
Possibly non-integer stats (float, string) in future version
BeardAch will have compatible version out or a temp. addon for BeardStat 0.6
Thank you for choosing to use BeardStat :).
0.5.4... Cannot use floats (decimals) for stat calculation. For example;
custom.foottravel = $stats.move * 0.62137
Default custom stat is bad, it sets kills - deaths for the ratio, should be kills dvivided by deaths.
@Sharkykzn
Hey! For all who had the same question here's a basic php I scripted to go outside their api. Just grabs the top 10 playtimes.
@Sharkykzn
I'm with you on that, I just want to embed the top 10 most playtime. I'll let you know if I figure it out.
Seeking advice on how to integrate web stats on a PHP website, pulled from this plugin. Any available templates or code?
@Bl0c
Which version are you running? 0.5.4 should fix the error
What is this error ?
03.04 00:11:06 [Server] SEVERE at java.lang.Thread.run(Thread.java:722)
03.04 00:11:06 [Server] SEVERE at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
03.04 00:11:06 [Server] SEVERE at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
03.04 00:11:06 [Server] SEVERE at me.tehbeard.BeardStat.DataProviders.MysqlStatDataProvider$1.run(MysqlStatDataProvider.java:220)
03.04 00:11:06 [Server] SEVERE at me.tehbeard.BeardStat.containers.PlayerStatBlob.<init>(PlayerStatBlob.java:68)
03.04 00:11:06 [Server] SEVERE java.lang.ClassCastException java.util.Collections$SynchronizedSet cannot be cast to java.util.HashSet
03.04 00:11:06 [Server] SEVERE Exception in thread "pool-4-thread-95"
03.04 00:11:05 [Multicraft] winstarx7 ran command Message du Jour
Is it possible to add a statistical "distance being sneak" Sorry for MultiPost I gradually discovers the missing stats