Stats by Lolmewn
Stats - made by Lolmewn
Plugin description
Stats is an advanced statistics gathering plugin, currently focused on player statistics. Information such as PVP kills, blocks broken, playtime and much more. You can store this data as simple files, or store them in a MySQL database. The benefit of using the database is that you can also use any web-end out there to display your players' statistics on your website.
Installation instructions
To install the plugin, simply drag-and-drop the Stats.jar into your 'plugins' folder.
When you start the server, a "Stats" folder will be created, containing a config file.
For a detailed description on the config file, click here.
The most important option is "storage", which can be set to either "flatfile" or "mysql" by default.
If you choose MySQL, there is another file (mysql.yml). Fill in your MySQL details there. That's all!
If you're installing a web-end as well, please read the instructions for said web-end on how to install it.
A list of web-ends compatible with Stats 3:
Made one, too? Let me know!
List of available Stats
This is a list of all available stats. Please note that there might be more stats in your environment, as other plugins can add their own stats to the plugin. For those stats, please see the documentation of the plugin providing them.
| Stat name | Description | Available Metadata |
| Arrows | Amount of arrows shot (not hit!) | world |
| Beds entered | Self-explanatory | world |
| Blocks broken | Self-explanatory | world, name, data (see here for more info) |
| Blocks placed | Self-explanatory | world, name, data (see here for more info) |
| Buckets emptied | Self-explanatory | world |
| Buckets filled | Self-explanatory | world |
| Commands done | Amount of commands done | world |
| Damage taken | Self-explanatory | world, cause |
| Death | Amount of times died | world, cause |
| Eggs thrown | Self-explanatory | world |
| Fish caught | Self-explanatory | world |
| Items crafted | Self-explanatory | world, name |
| Items dropped | Self-explanatory | world, name |
| Items picked up | Self-explanatory | world, name |
| Joins | Amount of times joined the server | None |
| Kill | Amount of kills gotten | world, (name of) weapon, entityType |
| Last join | Last time (in milliseconds epoch time) joined the server | world |
| Last seen | Last time (in milliseconds epoch time) left the server | world |
| Money | Not yet functional | world |
| Move | Amount of blocks moved | world, type (0 = walking, 1 = boat, 2 = minecart, 3 = pig, 4 = on a pig in a minecart, 5 = horse, 6 = flying) |
| Omnomnom | Amount of food eaten | world |
| PVP | PVP kills gotten | world, victim (UUID of the other player), time (in milliseconds epoch time), (name of) weapon |
| PVP streak | Current kill-chain, gets reset when killed | world |
| PVP top streak | Highest PVP streak ever achieved - may be moved to Highscores in the future | world |
| Playtime | Time in seconds played on the server | world |
| Shears | Amount of sheeps sheared | world |
| Teleports | Amount of times teleported | world |
| Times kicked | Self-explanatory | world |
| Tools broken | Self-explanatory | world, name |
| Trades | Amount of times traded with a villager | world |
| Votes | Removed since 3.1.1-RC due to incompatibility. If the player name is not found, the vote is ignored | None |
| Words said | Amount of words said | world |
| Times changed world | Self-explanatory | None |
| Xp gained | Amount of XP gained in total | world |
Permissions
Some commands require special permissions to be executed. Here is a list with all permission nodes:
| Node | Default value | Description |
| stats.view | true | Access to /stats |
| stats.view.others | true | Access to /stats <player> |
| stats.custom | op | Gives access to nodes stats.add and stats.create |
| stats.add | op | Access to /stats add |
| stats.create | op | Access to /stats create |
| stats.admin | op | Access to /stats admin |
| stats.reset | op | Gives access to nodes stats.reset.self and stats.reset.others |
| stats.reset.all | op | Access to /stats reset all |
| stats.set | op | Access to /stats set |
| stats.sign.place | op | Can create [Stats] signs |
More info soon
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
-
View User Profile
-
Send Message
Posted Oct 21, 2014@Lolmewn
Alright thanks for the advice!
-
View User Profile
-
Send Message
Posted Oct 21, 2014@Martijnie
Actually, the way snapshots work is that they make a 'snapshot' of the data at that time frame. So basically, if you have 1000 playtime and a snapshot is made, it'll say 1000 playtime. Then later, when you have 2000 playtime and the next shapshot is made, it'll say 2000.
To get the top of a month, you probably are going to have to execute multiple queries (Maybe not, idk). Get the latest taken snapshot (or the main_snapshot) and subtract the oldest snapshot (which is almost a month old), then sort them by playtime.
-
View User Profile
-
Send Message
Posted Oct 21, 2014@Lolmewn
Alright the latest build works perfect. I have another question though hehe.
I'm currently using this query to get the top scores of distance traveled:
"SELECT player_id,SUM(distance) AS value FROM {$dbPrefix}move "
. " WHERE snapshot_name='auto_generated_snapshot'"
. " GROUP BY player_id ORDER BY SUM(distance) DESC LIMIT 10";
And I use this config:
snapshots:
enabled: true
timeToLive: 1M
interval: 30m
previous: 0
I thought this would save stats for 1 month, and save them at an interval of 30 minutes, deleting the old snapshots. However the old snapshots are not deleted (as you can see here, multiple snapshots with the same player_id: http://puu.sh/ckKFN/e08e0bb785.png).
It means that the query I use shows distance traveled from snapshot 1 + distance traveled snapshot 2 etc. Is it right that snapshots are not deleted? Or is this a fault in my query?
-
View User Profile
-
Send Message
Posted Oct 20, 2014@Lolmewn
Alright will do. Thanks for providing updates :)
-
View User Profile
-
Send Message
Posted Oct 20, 2014@StillSwingin
It appears this might be the case for tables that don't have 'snapshot_time' and/or 'snapshot_name' columns. Could you printscreen the tables that you have for Stats?
EDIT: I've improved checks for snapshots. Check out the latest dev build.
-
View User Profile
-
Send Message
Posted Oct 20, 2014@StillSwingin
What version?
-
View User Profile
-
Send Message
Posted Oct 20, 2014Hi, I'm trying to track the playtime of normal users at my server but I can't do it. I have usePermissionsForTracking set to false and only admins get their time tracked. Everyone has their blocks placed, deaths, etc. tracked though. But normal users seem not to have their time tracked.
Thank you
-
View User Profile
-
Send Message
Posted Oct 20, 2014@Lolmewn
Just tried using the latest dev build and I'm still getting this error D: http://pastebin.com/ciFANb2x
-
View User Profile
-
Send Message
Posted Oct 20, 2014@Lolmewn
Alright will do and tell you if that solved the issues :D
-
View User Profile
-
Send Message
Posted Oct 20, 2014@SniperBoss17
Because the amount of data is huge, and because a big part of the plugin revolves around showing it on a website. Besides, 90% of servers have a MySQL database, anyway.
@Martijnie
1.4? That's like, super old O.o I suggest you update ;)
-
View User Profile
-
Send Message
Posted Oct 19, 2014@Lolmewn
The 1.4 dev version from bukkit (so not the one from jenkins).
-
View User Profile
-
Send Message
Posted Oct 19, 2014Why does it force you to use SQL? I know 3 other plugins that don't need SQL to run -.-
-
View User Profile
-
Send Message
Posted Oct 19, 2014@Martijnie
Which version are you using?
-
View User Profile
-
Send Message
Posted Oct 19, 2014@Lolmewn
Hi. First off, great plugin :D I'm using it at http://woa.pw
I am getting the following errors though every 30 minutes (snapshot interval): http://pastebin.com/D1GZf3dc
This is how my config snapshot settings are:
snapshots: enabled: true timeToLive: 1M interval: 30m previous: 0
-
View User Profile
-
Send Message
Posted Oct 19, 2014@GodsDead
Never seen that before. Maybe there is a new version of the MySQL pool library I am using which got added in the latest stats? No idea if that's the case :P
-
View User Profile
-
Send Message
Posted Oct 16, 2014@GodsDead Did you change
debug: false
to true? Doesn't seem like an error, but rather a debug message, which is why I ask.
-
View User Profile
-
Send Message
Posted Oct 13, 2014Been having this issue every time my server boots: http://pastebin.com/HCwv99YR
-
View User Profile
-
Send Message
Posted Oct 8, 2014@Lolmewn
No sweat, The fact you're responding is a good sign! I will continue to cobble together, I work full-time so I can only do bits in the odd time I have, When I have something a bit more solid and release it i'll start searching for some other developers to help me out, and we will have the most kick ass web UI :)
-
View User Profile
-
Send Message
Posted Oct 8, 2014@GodsDead
Nice :) Looking forward to that. I'm still ( :( ) very busy with uni so I'm not sure when I'll be able to fix bugs... "Soon" I hope.
-
View User Profile
-
Send Message
Posted Oct 7, 2014If you guys need help with testing the new web UI or the new fluid mc stats. I can help out. Please PM me here! Thanks!