Skip to content

How does Statz record its data?

Staartvin edited this page Jul 21, 2016 · 27 revisions

Statz records quite a bit of data, as can be seen here. To make sure this data is properly stored and easy and efficient to retrieve, Statz uses either SQLite or MySQL (depending on the choice of the configuration options). Since this page is not meant for an introductory course on SQL and database, I'll provide you a link to a tutorial on the internet: http://www.sqlcourse.com/intro.html.

Table of contents:


Data stored in Statz's database

Statz records a multitude of different datasets and arranges them in tables. For example, Statz has a table called 'statz_distance_travelled' that contains all info about the ways players travel. Every table will be discussed here. Every table consists of columns that hold specific info about an action. The identifier and info stored by each column vary over tables, but every table has at least an id column that will track the changes across the table.

statz_blocks_broken

This table holds all info about the blocks a player has broken. It has 5 columns (excluding the id column): uuid, value, world, typeid and datavalue.
The UUID column stores, coincidentally, the UUID of the player.
The VALUE column stores the number of blocks that were broken for a specific block.
The WORLD column stores on what world the blocks were broken.

Penultimately, the TYPEID column stores the id of the block that was broken. For example, a torch has id 50 (for reference, see http://www.minecraftwiki.net/images/8/8c/DataValuesBeta.png).

Lastly, the DATAVALUE column stores the extra data that is sometimes associated with the broken block. For example, a torch does not have a data value, but wool (id 35) has a data value for each color (white wool has data value 0, while black wool has data value 15).

statz_blocks_placed

This table has exactly the same columns as statz_blocks_broken, but is associated with placed blocks instead of broken ones.

statz_damage_taken

This table holds info about players that took damage in some way or form. It has 4 columns (excluding the id column): uuid, value, world and cause.
The UUID column stores, coincidentally, the UUID of the player.
The VALUE column stores the amount of damage a player has taken.
The WORLD column stores on what world the damage was taken by the player.
The CAUSE column stores in what way the player was hurt. It can take any of the following forms: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html.

statz_deaths

The deaths table is used to store info regarding the deaths of any player on the server. It has 3 columns (excluding the id column): uuid, value and world. The UUID column stores, coincidentally, the UUID of the player.
The VALUE column stores how many times a player has died. The WORLD column stores on what world the player has died.

statz_distance_travelled

This table consists of data used to track the movement of players. It has 4 columns (excluding the id column): uuid, value, world and moveType.
The UUID column stores, coincidentally, the UUID of the player.
The VALUE column stores how far a player has travelled. The WORLD column stores on what world the player travelled. The MOVETYPE column stores in what way the player travelled. This can either be:

  • BOAT
  • FLY
  • MINECART
  • PIG
  • PIG IN MINECART
  • HORSE
  • HORSE IN MINECART

Data not stored in Statz's database, but retrievable by Statz

Clone this wiki locally