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

# Developer API

Developer reference for ManticRods integrations

ManticRods exposes the static `ManticRodsAPI` entry point, `RodUseEvent`, the deprecated `ShardsGiveFromFishingEvent`, and `EconomyProvider`.

## Add the API to your build

The API is published to our Maven repository, so there is nothing to install locally.

```xml
<repositories>
  <repository>
    <id>mantic</id>
    <url>https://repo.mantic.dev/public</url>
  </repository>
</repositories>

<dependency>
  <groupId>me.fullpage</groupId>
  <artifactId>manticrods-api</artifactId>
  <version>2.0</version>
  <scope>provided</scope>
</dependency>
```

Gradle:

```kotlin
repositories {
    maven("https://repo.mantic.dev/public") {
        content { includeGroup("me.fullpage") }
    }
}

dependencies {
    compileOnly("me.fullpage:manticrods-api:2.0")
}
```

The JAR keeps class and member signatures while replacing method bodies with stubs. Use it only to compile an integration; never install it on a server or bundle it in another plugin. Published versions are browsable at <https://repo.mantic.dev/\\_browse/public>.

Declare ManticRods in the integration plugin's `plugin.yml`:

```yaml
depend: [ManticRods]
```

## Common calls

```java
import me.fullpage.manticrods.api.ManticRodsAPI;
import me.fullpage.manticrods.data.Enchants;
import me.fullpage.manticrods.enchants.Enchant;
import me.fullpage.manticrods.wrappers.MPlayer;
import me.fullpage.manticrods.wrappers.Rod;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

public final class RodsIntegration {
    public void commonCalls(Player player) {
        MPlayer data = ManticRodsAPI.getPlayer(player);
        if (data != null) {
            double shards = data.getAccurateShards();
            data.addShards(25.0);
        }

        Rod heldRod = ManticRodsAPI.getRod(player);
        Enchant enchant = Enchants.get().getEnchant("autosell");
        if (heldRod.isValid() && enchant != null) {
            int level = heldRod.getLevel(enchant);
        }

        Rod newRod = ManticRodsAPI.getRod("default", player);
        if (newRod != null && newRod.isValid()) {
            ItemStack rodItem = newRod.getItemStack();
        }
    }
}
```

`getPlayer` also accepts `OfflinePlayer`, UUIDs, UUID strings, and player names; it returns `null` when it cannot resolve an identifier. `getRod(type, player)` returns `null` when the type is not configured. It creates a rod item but does not add it to the inventory. For an item-based helper, check `isValid()` before calling rod-specific methods. `getRodSettings()` returns a read-only list.

`getPlayers()` returns tracked records as a read-only collection. `getRodSetting(type)` looks up one configured rod. `getFirstJoinRod(player)` returns an optional item, and `isLucky` and `parsePlaceholderApi` expose the matching plugin helpers.

Use `getAccurateShards()` when fractional balances matter. `getShards()` is deprecated and truncates fractional balances. `MPlayer` also provides `addShards`, `takeShards`, and `hasEnoughShards`.

## Events and providers

Listen for `RodUseEvent` to inspect or modify fishing loot, shards, XP, and money. Register Bukkit listeners with the `PluginManager`. `ShardsGiveFromFishingEvent` is deprecated in favor of `RodUseEvent`.

`ManticRodsAPI` exposes the configured shard, upgrade, shop, and money providers. You can implement `EconomyProvider` and register it with `ManticRodsAPI.registerEconomyProvider` for a separate custom economy integration. `ManticRodsAPI.giveMoney` pays through the configured money provider; `getSellPrice` returns the plugin's calculated sell price.
