> ## Documentation Index
> Fetch the complete documentation index at: https://jppmc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# JPPrison Developer API — Plugin Integration Overview

> Integrate shops, crates, and quests with JPPrison via the Java API. Read and write balances, fire purchases, listen for events, and use PlaceholderAPI.

JPPrison exposes a Java API for plugin developers who need to read or write economy balances, check if a player can afford something, or react to economy transactions. This is useful for shop plugins, crate plugins, quest systems, and web stores.

## Available API Surface

* **`JPPrisonAPI`** — static economy management class for reading and modifying balances
* **`BalanceChangeEvent`** — cancellable Bukkit event fired before every balance write
* **`EconomyCost`** — cost string parser that supports config-driven, multi-economy pricing
* **WorldGuard flag accessor** — check whether a location is inside a JPPrison-managed rewards region
* **PlaceholderAPI expansion** — use `%jpprison_<variable>%` in scoreboards, holograms, chat, and tab lists

## Getting the API

Declare JPPrison as a dependency in your `plugin.yml` so Bukkit loads it before your plugin:

```yaml theme={null}
# plugin.yml
depend: [JPPrison]
```

If your plugin can function without JPPrison, declare it as a soft dependency instead:

```yaml theme={null}
# plugin.yml
softdepend: [JPPrison]
```

When using a soft dependency, guard every API call with a presence check:

```java theme={null}
if (Bukkit.getPluginManager().getPlugin("JPPrison") != null) {
    double balance = JPPrisonAPI.getBalance(uuid, "tokens");
}
```

## Maven / Gradle

Include the JPPrison jar as a `provided` (compile-only) dependency in your build — it must be present on the server at runtime, but you should not bundle it inside your own jar.

```xml theme={null}
<!-- Maven -->
<dependency>
    <groupId>com.jpprison</groupId>
    <artifactId>jpprison</artifactId>
    <version>LATEST</version>
    <scope>provided</scope>
</dependency>
```

```groovy theme={null}
// Gradle
compileOnly files('libs/JPPrison.jar')
```

## Explore the API

> **[Economy API](/api/economy-api.md)**
>
> Read balances, give and take currency, and process atomic purchases with `JPPrisonAPI`.

> **[Events](/api/events.md)**
>
> Listen for `BalanceChangeEvent` to react to or cancel any economy transaction.

> **[Placeholders](/api/placeholders.md)**
>
> Use `%jpprison_<variable>%` with PlaceholderAPI in scoreboards, holograms, and chat.

> **[WorldGuard Integration](/api/economy-api.md#worldguard-flag)**
>
> Access the `jpprison-enchants` flag to check reward regions from your own plugin.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.