# API Usage

## Spawner Stack Size

```java
// Default Bukkit way
Location location = new Location(Bukkit.getWorld("world"), 0, 0, 0);

// Returns the stack size of the spawner
MobStackerAPI.getInstance().getSpawnerStackAmount(location);

// Returns the stack size of the spawner
MobStackerAPI.getInstance().getSpawnerStackAmount(location.getBlock());


// More Optimized solution
BlockCoordinates coords = new BlockCoordinates(0, 0, 0, "world");

// Returns the stack size of the spawner
MobStackerAPI.getInstance().getSpawnerStackAmount(coords);
```

## Mob Stack Information

```java
// Grab the entity
Entity entity = event.getEntity();

// Grabt the stacked mob by using the entity UUID
StackedMob stackedMob = MobStackerAPI.MOBS.get(entity.getUniqueId());

// Deduct an amount from the stacked amount
stackedMob.removeCount(int amount);

// Add to the stacked amount
stackedMob.addCount(int amount);

// Returns the entity instance
stackedMob.getEntity();

// Returns the stack size
stackedMob.getCount();
```


---

# 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://docs.elapsed.dev/plugins/mobstacker/api-usage.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.
