# Developer API

### Add the Dependency

Don't forget to change always the version!

<div align="left"><img src="https://img.shields.io/maven-metadata/v.svg?label=KillStatsAPI&#x26;metadataUrl=https://repo.mongenscave.com/releases/com/mongenscave/mc-KillStatsAPI/maven-metadata.xml" alt=""></div>

{% tabs %}
{% tab title="Maven" %}

<pre class="language-xml" data-full-width="true"><code class="lang-xml"><strong>&#x3C;repository>
</strong>  &#x3C;id>MonGens-Cave&#x3C;/id>
  &#x3C;url>https://repo.mongenscave.com/releases&#x3C;repository>&#x3C;/url>
&#x3C;/repository>

&#x3C;dependency>
  &#x3C;groupId>com.mongenscave&#x3C;/groupId>
  &#x3C;artifactId>mc-KillStatsAPI&#x3C;/artifactId>
  &#x3C;version>[VERSION]&#x3C;/version>
&#x3C;/dependency>
</code></pre>

{% endtab %}

{% tab title="Gradle" %}

```groovy
maven { url "https://repo.mongenscave.com/releases" }

implementation "com.mongenscave:mc-KillStatsAPI:[VERSION]"
```

{% endtab %}
{% endtabs %}

### Add mc-KillStats to plugin.yml

{% tabs %}
{% tab title="as depend" %}

```yaml
depend:
  - mc-KillStats
```

{% endtab %}

{% tab title="as softdepend" %}

```yaml
softdepend:
  - mc-KillStats
```

{% endtab %}
{% endtabs %}

### Example how to use the KillStatsAPI

For example, use the Anti Killfarm system and validate kills with the API!

```java
KillStatsAPI api = KillStatsAPI.getInstance();

boolean valid = api.isValidKill("Player1", "Player2");
if (valid) {
    System.out.println("This is a valid kill!");
} else {
    System.out.println("Invalid kill!");
}
```
