> For the complete documentation index, see [llms.txt](https://simplymines.gitbook.io/simplymines-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simplymines.gitbook.io/simplymines-docs/introduction/api-developer-guide/api-setup.md).

# API Setup

## API Setup

SimplyMines exposes a Java API (added in **1.1.0**) via `me.simplyran.simplymines.api.SimplyMinesAPI`, plus the custom `BlockBrokenInMineEvent`.

### Add SimplyMines as a dependency

SimplyMines is available through [JitPack](https://jitpack.io/#SimplyRan/SimplyMines). Use `compileOnly`, then declare SimplyMines in `plugin.yml`.

Change `v1.1.0` To the required release tag from the [release list](https://github.com/SimplyRan/SimplyMines/tags).

{% hint style="warning" %}
If it doesn't work, try using the latest commit with `master-SNAPSHOT` instead of the version number.
{% endhint %}

{% tabs %}
{% tab title="Gradle (Groovy)" %}

```groovy
repositories {
    maven { url = "https://jitpack.io" }
}

dependencies {
    compileOnly "com.github.SimplyRan:SimplyMines:VERSION"
}
```

{% endtab %}

{% tab title="Gradle (Kotlin)" %}

```kotlin
repositories {
    maven("https://jitpack.io")
}

val simplyMinesVersion = "v1.1.0"

dependencies {
    compileOnly("com.github.SimplyRan:SimplyMines:VERSION")
}
```

{% endtab %}

{% tab title="Maven" %}

```xml

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.SimplyRan</groupId>
        <artifactId>SimplyMines</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
```

{% endtab %}
{% endtabs %}

```yaml
depend: [SimplyMines]      # or softdepend, if the integration is optional
```

{% hint style="info" %}
Use `depend` when your plugin requires SimplyMines. Use `softdepend` only for optional integrations.
{% endhint %}

***

### Get the API instance

`SimplyMinesAPI` registers itself as a singleton when SimplyMines enables:

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

{% hint style="info" %}
Make sure your plugin's `onEnable` runs after SimplyMines has enabled — use `depend`/`softdepend` in `plugin.yml`, and Bukkit will guarantee load order for you.
{% endhint %}

***

### What you can do

* [Mines API](/simplymines-docs/introduction/api-developer-guide/mines-api.md) — read, create, and delete mines; read a player's wand selection.
* [Requirements API](/simplymines-docs/introduction/api-developer-guide/requirements-api.md) — attach, read, and update requirements.
* [Events](/simplymines-docs/introduction/api-developer-guide/events.md) — listen for `BlockBrokenInMineEvent`.

***

### Minimal example

```java
public class MyIntegration {

    public void onExampleUsage() {
        SimplyMinesAPI api = SimplyMinesAPI.getInstance();

        BasicMine mine = api.getMine("diamond");
        if (mine != null) {
            api.setTimeResetRequirement("diamond", 600);       // reset every 10 minutes
            api.setPercentResetRequirement("diamond", 20.0);   // ...or once 20% is left
            api.setPermissionRequirement("diamond", "myserver.mines.diamond");
        }
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://simplymines.gitbook.io/simplymines-docs/introduction/api-developer-guide/api-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
