Stats & Achievements
This Project is currently abandoned (and probably will forever be). See here for a alternative plugin
2-in-1 Stats and Achievements

This plugin logs various player activity as stats in a MySQL or SQLite database. With the integrated achievement system it is possible to award players when they reached a predefined target.
Features
- Logs block, mob, pvp and miscellaneous player statistics very detailled
- Logs also crafting statistics when spout is installed
- Integrated achievements system
- New database format which is more performant than older databases
- Integrated time delay to reduce server load and the number of SQL queries
- Planned web stats system
- Compatible with every Bukkit version since 1.1-R4
Tools
- You can convert older databases using our utility: http://89.144.25.51:8888/convert.php
- Achievements generator (will be extended soon): http://plugins.maniacraft.de/SaAPlugin/achgen
Requirements
- Vault (Permissions)
- Spout (if you want to get crafting stats)
Commands
- /stats help - General Help
- /stats [<player>] - Shows your stats or stats by <player>.
- /stats block [<player>] <block>[:<data>] - Shows stats for <block>.
- /stats pvp [<player>] [<player2>] - Shows PVP stats.
- /stats mob [<player>] [<mob>] - Shows mob damage stats.
- /achievements help - General Help
- /achievements [<player>] - Shows your obtained achievements or achievements obtained by <player>.
- /achievements list [<page>] - Lists all available achievements.
- /achievements admin add <name> <description> <category> <block> <data> <value> <command> - Adds a new achievement.
- /achievements admin remove <id> - Removes the achievement <id>.
- /achievements admin convert - Convert old achievements.
Achievement Commands
- /give <block>[:<data>] [<amount>] - gives the player the item <block> <data>
- All commands available on your server. Example (Essentials warp): /warp darkroom %player%
Permissions
| Permission | Description |
|---|---|
| stats.show.blocks.own | Show own block stats |
| stats.show.blocks.other | Show block stats by others |
| stats.show.pvp.own | Show own pvp stats |
| stats.show.pvp.other | Show pvp stats by others |
| stats.show.mob.own | Show own mob stats |
| stats.show.mob.other | Show mob stats by others |
| stats.overview.own | Show your overview |
| stats.overview.other | Show overview by others |
| stats.receive | Log stats at all (for example not for Guests) |
| achievements.receive | Gives achievements at all (for example not for Guests) |
| achievements.admin.remove | Admin Command Remove |
| achievements.admin.add | Admin Command Add |
| achievements.admin.convert | Admin Command Convert achievements from old DB |
| achievements.list | List all achievements |
| achievements.show.own | Show obtained achievements |
| achievements.show.other | Show achievements obtained by others |
Config
general: language: en # Language (Available: en/de, other languages can be added in plugins/StatsAndAchievements/lang/) update-delay: 30 # The time interval in seconds how often the stats will be updated in the database (Default and recommended: 30) achievements: true # Activating and deactivating Achievements text_color: '&6' # Color of command texts (1st color) data_color: '&7' # Color of data output (2nd color) debug: false # Debug output (Default and recommended: false) database: type: mysql # Database type, either mysql or sqlite table_prefix: '' # Table prefix to save stats of more than one server in a single database host: localhost # Only MySQL: Database server (Default: localhost) port: 3306 # Only MySQL: Database server port (MySQL default 3306) database: minecraft # Only MySQL: Database name user: root # Only MySQL: Database user password: stats123 # Only MySQL: Database password DisabledWorlds: # In this worlds the stats will be deactivated - disabledworld1 - creative listeners: blockStats: true # Block related stats brewingStats: true # Brewing related stats (maybe bugged) craftingStats: true # Crafting related stats (maybe bugged) enchantingStats: true # Enchanting related stats (maybe bugged) entityStats: true # Entity related stats playerStats: true # Player related stats (Your really should NOT disable this or you'll break everything!) playerMoveStats: true # Player move stats (if you experience lags you should set this to false) vehicleStats: true # Vehicle related stats
Language file formating
{br} - Line break
&[0-f] - Color codes (http://img109.imageshack.us/img109/4334/mccolors.png)
%[A-Z0-9]% - Internal variables, don't supposed to be translated!
-
View User Profile
-
Send Message
Posted Apr 26, 2012Is there a possibility to add statics from other plugins? I would like SimpleSpleef to be able to hook into your statistics plugin and send data on players winning or loosing the game.
-
View User Profile
-
Send Message
Posted Apr 26, 2012@wattzy
Fantastic! You rock dude.
I would love to know why my achievements aren't triggering, but that might be my problem to deal with. Is anyone else's LASTLOGOUT not updating? Or is that just me.
YOU GUYS ARE AWESOME! Love this plugin :)
-
View User Profile
-
Send Message
Posted Apr 26, 2012@wattzy
nice :)
-
View User Profile
-
Send Message
Posted Apr 26, 2012@wattzy
I love you? :)
Can't wait to see this. I was already looking for another plugin =/
-
View User Profile
-
Send Message
Posted Apr 25, 2012@PainKNero
Well I have some good news for you, and most other people who use this plugin.
I got bored recently so decided to dig into the plugin. I think I've found the problem with it eating memory like there's no tomorrow, and I'm testing the new code on my server now.
I've contacted ManiacTwister and once I've sorted out the few issues I've got sending the code, hopefully a version can be released to solve those problems.
Also, as a plus (just because I could), I managed to get crafting stats working, (without spout) as well as record other death types (Drowning, burning, lava, etc.etc.)
More news when I know what is happening :)
-
View User Profile
-
Send Message
Posted Apr 25, 2012@wattzy
yes, i am using the remotetoolkit to restart once a day in the morning at 05:30. Since SAA will "eat" my RAM, i restart more than once a day to prevent the memoryleak. Will be helpfull, but not fine.
-
View User Profile
-
Send Message
Posted Apr 21, 2012sometimes get this (saa 1.7)
-
View User Profile
-
Send Message
Posted Apr 19, 2012@ThaMunsta
I'll see what I can do about it. But sincerely, I think it is beyond what I can do, as just from MySQL I cant do nothing about it. But, you can do some simple things if you want to use some PHP.
You can do like me and get online players using Minecraft Querys. Read the Readme file there and it'll explain almost everything you need to know.
Just get the Online Players from there and set your online list using that. For me, it's better and it's always accurate.
I'll look for other alternatives.
-Just to clarify: here is some pseudo-code to tell what I do to get Online Players from my Sever:
It is something like that. You can do that but instead of using Echo, you can add to an array and make some more controls. It's pretty easy.
You can mix that if you're running another server like me (I have my main survival server, a creative one that only me and moderators can Login and an Adventure Map that I open for some players. On the Status field, it'll say where the player are like: Online @ Test Server or Online @ Adventure_Map_Name.
-
View User Profile
-
Send Message
Posted Apr 19, 2012@ThaMunsta
@ThaMunsta: I set the delay to 90s, but the memory eater is still alive :(
-
View User Profile
-
Send Message
Posted Apr 19, 2012Could you post a little wiki how to use all achievements?
The normal Achievements as blockbreak, create and so on ... are no problem but the other Archievements as crafting and so on are a bit difficult, could you make a little wiki how to use them and what for commands as reward are possible with which Plugin (iConomy, Essentials ....) would be great if you could do that, so that I and others have it a bit easier! :)
-
View User Profile
-
Send Message
Posted Apr 18, 2012@PainKNero
I had to crank my update delay up to 60 seconds to prevent this. Things have been running smooth now.
@Gidedin
Can you think of a way to trigger the LASTLOGOUT when the player logs out? All my values are 0 which sucks because my web interface assumes they are logged in if login > logout... so everyone is always logged in lol Seems to work when I'm OP but aside from that I can't get it to update in the DB
-
View User Profile
-
Send Message
Posted Apr 18, 2012@wattzy
I use that too and recommend. Unfortunately I'm running my server on a x86 Windows XP computer and every 5 hours or so the server becomes very laggy and overloaded.
I've set my RTK to restart every 5 hours and takes roughly 22 seconds from stop to restart. Very simple and easy.
I'm still waiting for the Maniac answer about the Stats being recorded while on Creative =|
I can't get achievements on creative, but after I go out of it the achievement just popup as I've already reached what was necessarily (If the achievement are block destroy or anything like that).
If possible, don't record anything at all while on creative :-)
-
View User Profile
-
Send Message
Posted Apr 18, 2012@PainKNero
My advice, if you can (I know if your not hosting your own server it might be difficult) is to use the Minecraft RemoteToolkit (works with 1.2.5).
This will automatically detect and restart server crashes, as well as give you the ability to schedule server restarts automatically at any interval.
Or you could use something like SimpleRestart Plugin. (I don't use it so can't comment on reliability)
I use RemoteToolkit (I host my own server), and have it set to restart my Minecraft server every 7 hours (takes mine less than a minute to-do), mostly to keep performance to a premium.
But, mine will do what yours does if I leave it running for more than 12 hours. Starts with gradual slow down (Lots of can't keep up messages in the log) and eventually crashes.
You might also be able to achieve the same thing using a script if you don't want to use those. Like schedule a server restart or stop/start at specified times.
Hope this helps.
-
View User Profile
-
Send Message
Posted Apr 18, 2012ok...sadly: i disable all plugins, who aren't necessary for security or server maintenance. Just Essentials, Worldguard, Multiverse and SAA will stay.
Last step, disabling SAA, waiting 24h, and we see: No lost memory, no lost TPS after server-runtime 10-12h... server runs normal. It seems to be that it is SAA which kill my server every 12h after restart.
Can you check, if the code is written safe ? It will reserve memory and won't give it free after use ?
Very sadly, because the achievements are cool !!! The old versions 0.99 (sockenklaus) don't have any errors, but won't work on 1.2x Servers :(
-
View User Profile
-
Send Message
Posted Apr 18, 2012@Justins210
Are you using the last version available? It should be fixed there. If not, add this to your database:
It should work very fine for two things:
-
View User Profile
-
Send Message
Posted Apr 17, 2012After about 3 hours of play time, my players' play time gets set to some random number like 8134553. I don't have any idea how to fix this?
-
View User Profile
-
Send Message
Posted Apr 16, 2012@Galzen
Hey there Galzen.
You can do half of what you want, for that, do the following steps:
&6Congratulations! &9%player% &6just completed the achievement %achievement%&6! And for that, he was rewarded for &9%reward%&6!
In game, it should look like this:
Congratulations! Gidedin just completed the achievement Rocking Out! And for that, he was rewarded for 1x Diamond
I've placed some colors there to show the Player, the Achievement and the Reward in Blue, the message will be in gold. It looks nice.
The full archive would look like that:
== File: '../plugins/StatsAndAchievements/lang/SaAPlugin_en.properties' == pages = Showing page %site% of %sites% help = The following commands are available: show.achievements.all = Available achievements show.achievements.own = Show your obtained achievements show.achievements.other = Show achievements obtained by %player% show.achievements.help = %basecommand% help - Shows this help.{br}%basecommand% [<player>] - Shows your obtained achievements or achievements obtained by <player>.{br}%basecommand% list [<page>] - Lists all available achievements. show.achievements.admin.help = %basecommand% admin add <name> <description> <category> <block> <data> <value> <command> - Adds a new achievement.{br}%basecommand% admin remove <id> - Removes the achievement <id>. show.stats.hr = &8--------------------------------- show.stats.playtime = Play time: show.stats.blocksplaced = Blocks placed: show.stats.blocksdestroyed = Blocks destroyed: show.stats.kills = Killed: show.stats.deaths = Died: show.stats.joins = Logins: show.stats.help = Use /stats help for detailled statistics show.stats.overall.own = Your overview show.stats.overall.other = Overview of %player% show.stats.pvp = Shows PVP stats: %sourceplayer% -> %refplayer% show.stats.pvp.overall = Show PVP stats show.stats.killsdeaths = Killed/Killed by: show.stats.dmgdealttaken = Damage dealt/Damage taken: show.stats.mob = Show mob stats: %mob% -> %refplayer% show.stats.block.own = Show your block stats for "%block%" show.stats.block.other = Show block stats for "%block%" by %player% show.stats.block.createdestroy = Placed/destroyed: show.stats.help = %basecommand% help - Shows this help.{br}%basecommand% [<player>] - Shows your stats or stats by <player>.{br}%basecommand% block [<player>] <block>[:<data>] - Shows stats for <block>.{br}%basecommand% pvp [<player>] [<player2>] - Shows PVP stats.{br}%basecommand% mob [<player>] [<mob>] - Shows mob damage stats. achievements.nofreeslot = An achievement reward item is waiting for you!{br}You should get some free space in your inventory! achievements.notifytitle = Achievement get! achievements.notifychat = &6%player%&3 has received a new achievement! achievements.notifyreward = Reward: %reward% achievements.notifyachwidget = &6Congratulations! &9%player% &6just completed the achievement %achievement%&6! And for that, he was rewarded for &9%reward%&6! achievement.remove = Achievement %id% removed! achievement.add = Achievement successfully added!-
View User Profile
-
Send Message
Posted Apr 16, 2012Thanks for the explanation with the bundle en , it's more clear now. This file should be auto-created, that would be easier for new users to translate the text.
Is it possible to show the achievement's name when it's completed ? like on the older achievements
I want a message like "Achievement (achievement name) completed - (description) ! Reward : (reward, I use /money give %player% x)
I tested things like %name% %description% but it doesn't work :)
If we can do this, could we have a list of things we can customize in this file ? Thanks
-
View User Profile
-
Send Message
Posted Apr 16, 2012periodically get some errors:
And this one, sometimes, if achievement will be granted:
Also, once a day, server will be come total laggy, from 20 TPS down to 2 TPS, Restart needed. Don't know, if SAA produced that error, i try to disable plugin after plugin. Will be a hard one, because the lag will accour only once a day, no specific hour. I rise the updatetime from SAA to 90, i will look at that...
(fortunately there aren't so much plugins recently update or new, so on one of the next day, i will disable SAA too for a day, to look at the behaviour after that)
Greetings,
Nero
-
View User Profile
-
Send Message
Posted Apr 15, 2012@ManiacTwister
Thank Maniac, but there is a small thing yet: While on creative, I still get Stats even when the config is set to true.
The achievements is blocked and I didn't managed to get the test achievements I made, but I still was getting stats. It is supposed to be like that?
I wish I could block everything at all while on Creative ^_^"
Another thing (Sorry for asking all those things =/): Can you control when a player dies from falling, lava or some other way other then killed by monsters/players?