# 🛠️ Developer API

## Welcome to the VortexPrisonCore API

Welcome to the **VortexPrisonCore** API. This API allows developers to hook into the prison system, listen for custom events, and programmatically manage player data, mines, pickaxes, enchants, and more.&#x20;

{% hint style="info" %}
You can browse our available API versions and artifacts directly in your browser at our [repositiory](https://repo.vortexdevelopment.net/#browser).
{% endhint %}

### 📦 Dependency Management

To use the API, you need to add our Maven repository and the API dependency to your project.

#### Maven

Add the following to your `pom.xml`:

```xml
<repository>
    <id>vortex-repo</id>
    <url>https://repo.vortexdevelopment.net/repository</url>
</repository>

<dependency>
    <groupId>net.vortexdevelopment</groupId>
    <artifactId>VortexPrisonCore-API</artifactId>
    <version>latest</version> <!-- Use 'latest' or a specific version -->
    <scope>provided</scope>
</dependency>
```

#### Gradle (Groovy)

Add the following to your `build.gradle`:

```groovy
maven {
    url = uri("https://repo.vortexdevelopment.net/repository")
}
compileOnly 'net.vortexdevelopment:VortexPrisonCore-API:1.0.3'
```

***

### 🚀 Getting Started

#### Accessing the API

The main entry point for the API is the `VortexPrisonCoreApi` class. Note that you should always check if the plugin is enabled before accessing it. Additionally, each manager for specific modules can be null if that module is disabled in the configuration. All methods are statically accessible from the `VortexPrisonCoreApi` class.

#### 💠 API Modules

```java
@Nullable VortexPrisonCoreApi.getMineManager();
@Nullable VortexPrisonCoreApi.getPickaxeManager();
@Nullable VortexPrisonCoreApi.getEnchantManager();
@Nullable VortexPrisonCoreApi.getTokenManager();
@Nullable VortexPrisonCoreApi.getRankManager();
@Nullable VortexPrisonCoreApi.getBackpackManager();
@Nullable VortexPrisonCoreApi.getAutoSellManager();
@Nullable VortexPrisonCoreApi.getBombsManager();
@Nullable VortexPrisonCoreApi.getEconomyManager();
@Nullable VortexPrisonCoreApi.getBoosterManager();
@Nullable VortexPrisonCoreApi.getVoucherManager();
@Nullable VortexPrisonCoreApi.getPlayerDataManager();
```

The API is split into several modules to keep things organized:

* **MineManager**: Handle mine creation, retrieval, and interact with prison mines.
* **PickaxeManager**: Programmatically manage player pickaxes, their levels, and metadata.
* **EnchantManager**: Access and manage custom enchantments applied to pickaxes.
* **TokenManager**: Interact with the custom token economy system.
* **RankManager**: Manage player ranks and prestiges.
* **BackpackManager**: Programmatically interact with player backpacks and their contents.
* **AutoSellManager**: Manage the auto-sell system and sell multipliers.
* **BombsManager**: Interact with the custom bomb system for mining.
* **EconomyManager**: Access the main economy system (Vault integration).
* **BoosterManager**: Manage active global or personal boosters.
* **VoucherManager**: Create and manage redeemable vouchers.
* **PlayerDataManager**: Access and modify persistent player data (Gems, Stats, etc.).

***

### 🔔 Events

VortexPrisonCore fires several custom events that you can listen to in your own plugins:

* **MineBlockBreakEvent**: Fired when a player breaks a block inside a prison mine.
* **MineBlockPlaceEvent**: Fired when a player places a block inside a prison mine.
* **AsyncMineEnterEvent**: Fired asynchronously when a player enters a mine region.
* **AsyncMineLeaveEvent**: Fired asynchronously when a player leaves a mine region.
* **AddExperienceEvent**: Fired when a player gains experience (Pickaxe, Rank, etc.).
* **InventoryItemAddEvent**: Fired when an item is added to an inventory via core systems (AutoSell, Backpacks).

***

### 📄 Plugin.yml

If you are depending on VortexPrisonCore, don't forget to add it to your `plugin.yml` to ensure proper load order:

```yaml
depend: [VortexPrisonCore]
# OR
softdepend: [VortexPrisonCore]
```


---

# Agent Instructions: 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:

```
GET https://wiki.vortexdevelopment.net/projects/vortexprisoncore/developer-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
