# Default statistics system

A default statistics system can be enabled in your plugin configuration.

See the below links:

[configuration](https://timsixths-plugins.gitbook.io/minigameapi-docs/2.0.0-alpha1/basic-features/configuration "mention")

[configurators](https://timsixths-plugins.gitbook.io/minigameapi-docs/2.0.0-alpha1/basic-features/configuration/configurators "mention")

[override-configuartors](https://timsixths-plugins.gitbook.io/minigameapi-docs/2.0.0-alpha1/basic-features/configuration/override-configuartors "mention")

The default statistics system saves only wins and loses.

**How to enable the default stats system?**

Set useDefaultStatsSystem to **true** in your PluginConfiguartion.

<pre class="language-java"><code class="lang-java"><strong>builder.useDefaultStatsSystem(true)
</strong></code></pre>

**How to add stats to users?**

Stats can be added in two different ways:

1. &#x20;When something is changed maybe the player has won the game.

* Create a new user or get
* Add stat

```java
UserStats userStats = statisticsManager.getUserStatsOrCreate(player, arena);
userStats.addWin();
```

2. &#x20; When the game ended.

The second way is the same but the method is called when the game is ended, maybe in the class which calls GameWinState.

Remember that stats must be saved in your UserGame object.
