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!
Hey, what was the command to import the table? The conversion site with the instructions seems to be down. Also, is the bug where some players got insane amounts of time played fixed?
@Gidedin
i use mysql, not sqllite.
I'm having some problems. Normal players may not own stats and achievements when i added the permissions.
@ManiacTwister
Thank you :) I'll start doing that on my Achievements now. All they have 'command' NULL because I didn't see that :P
I edit the entire database already, placing some triggers to control dates and a 'I did Everything' achievement.
I just don't know how to record Crafting, experience and things like that. I installed Spout, but nothing happend =/
-Just to say: I download almost every single Spout dev thing available in their site. Or the server resulted in an error or the saa said: linked with spout.
But I can't get any 'Crafting' or 'Crafted' or anything different from ITEMDROP, BLOCKDESTROY or BLOCKCREATE and so on.
@Gidedin
I think the section "Achievement Commands" above should explain everything about this. (%player% will be replaced with the login)
Hey, your plugin is really helpful but there is a bug with the column "PLAYTIME". Some of my players have 2667218749 seconds played but they are really played about only some hours. Please, fix it.
Thanks for the response. I have not really used a database viewer. I set the MySQL up for anti-grief plugins and other stuff, but I've never really messed with it much on the server end, just in-game commands mostly. I will look in to this more before I ask for further help. It seems like a great idea, and hope I can figure out how to get it working.
Hey there.
I'm wondering: There is a way to say, in the column 'command' on player_achievements, something like this:
/sudo say Omg! I just completed Everything!
Or...
/broadcast {PLAYERNAME} just achieved everything!
There are any variables to do that?
And, how do I give item to the player who achieve something? /give will take the player as the first parameter automatically?
@PainKNero
It isn't working with SQLite. Are you using MySQL or SQLite?
@MERCHANToDEATH
The easy think is to use a DataBase Viewer while using MySQL. Will be easy for you to see and edit your achievements.
But, here is a simple achievement SQL:
INSERT INTO `achievements` (`name`, `description`, `type`, `block`, `data`, `value`, `command`) VALUES ('Achievement Name', 'Mine 1 Stone Block!', 'BLOCKDESTROY', 1, 0, 1, '/say Test');
Where:
Error in Server Log (CB124R1):
12:39:43 [WARNING] Can't find bundle for base name SaAPlugin, locale de
Same if i choose locale "en".
Could you post a simple example achievement command, like an achievement for cutting down 100 pieces of wood. I am totally confused about how to create these things. A video showing how to create an achievement would be even cooler. thx.
Update...: ok, i see... the reward command will begin with a "/" ... my fault....
@Twister: thx for the list !
Hmm... can anybody help me ? in Table "Stats" everything is logged, now i build a simple testachievement (1 dirtblock destroy), "/achievements list" will show the possible achievement.
INSERT INTO `achievements` (`name`, `description`, `type`, `block`, `data`, `value`, `command`) VALUES ('Erde1', '1 Block Erde', 'BLOCKDESTROY', '3', '0', '1', 'give goldnugget 1');
but table "player_achievements" is emtpy and say "no index defined". Unfortunatly the testaccount has a full inventory,dispalys "an achievement is waiting for you" but after emptying inv, no nugget appears. Same with clear inv., no ach will be granted.
Another try with stone (id 1), the same. player_achievements table isn't fill with data !
(MC 1.2.4, CB 1.2.4 R1, Essentials 2.9.1)
@PainKNero
Hey,
Here are the Ids for Entitys in Achievements. But Please note: The ids have to be in the "data" field and if in data is PLAYER(42) the playerid have to be in the block field.
http://dev.bukkit.org/server-mods/saaplugin/pages/entity-ids-for-achievements-de-de/
How do I make an achievements like "kills ten chicken" ?
The SQL Syntax to create the database-entry will be:
INSERT INTO `achievements` (`name`, `description`, `type`, `block`, `data`, `value`, `command`) VALUES ('Huehnerhabicht I', 'You have killed 10 chicken!', 'KILLS', 'CHICKEN', '0', '10', 'give goldnugget 1');
but the field 'block' is an integer and cannot store varchars like 'CHICKEN'?
i just choose a table-prefix in the config (like "saa"), on start the plugin creates all tables "saa_stats, saa_players etc in the sqldatabase, stats.overview works, but stats block <username> will take out the error in serverlog:
Error in SQL query: Table 'xxxxxxxx.stats' doesn't exist
Some operations don't recogneized a given table-prefix ?
If i don't choose a prefix, all works fine.
Web stats generating page is essential! Please get this feature on!
@ManiacTwister
That's awesome! Seems to be working great now thanks! There is an issue with playtime updating. I am just testing from my local address with no other players yet. I will test it on my live server later today and let you know the results. Is it because the IP I am connecting with is local? Do I need Spout?
Thanks again!
Also, I can't get achievements to trigger for the life of me... Do I need to put like >500 for some things like movement? Is there an example anywhere?
UPDATE: playtime works when I am OP so I will check out whats wrong with my permissions.
is the web stats system coming soon?
@ThaMunsta
Ah..sory, version 1.4 is broken. I have uploaded 1.5 now.
But, the stats should be updatet, just achievements are affected in 1.4. Please try again with 1.5 and notify me if it doesnt work with is.
I must be missing something... I get this even with no players logged in:
2012-04-01 16:14:25 [SEVERE] java.lang.NullPointerException
2012-04-01 16:14:25 [SEVERE] at de.maniacraft.statsandachievements.Update.checkAchievements(Update.java:203)
2012-04-01 16:14:25 [SEVERE] at de.maniacraft.statsandachievements.Update.run(Update.java:58)
2012-04-01 16:14:25 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
2012-04-01 16:14:25 [SEVERE] at java.lang.Thread.run(Unknown Source)
1.4 on bukkit build 2126 using MySQL. The table seems to have created itself correctly and I see my user, but stats don't update and every 30 seconds when it tries I see that error. I'll play with it a bit more but I may wait till you have a web front end. Right now I would just be doing a PHP query on the DB and trying to make it pretty. I suck though. I can tell already my table sort won't work for some stuff haha. 1.2.5 is coming too so I won't get too eager. Keep up the great work though :D