# templates

The public API exposes templates as immutable `BotTemplateView` values.

## Read one template

```java
api.getTemplate("arena_cpvp").ifPresent(template -> {
    getLogger().info(template.key() + " -> " + template.botType());
});
```

The API resolves templates by key, internal name, or display name where possible.

## Read all templates

```java
for (BotTemplateView template : api.getTemplates()) {
    getLogger().info(template.key() + " -> " + template.displayName());
}
```

## `BotTemplateView` fields

| Field               | Description                          |
| ------------------- | ------------------------------------ |
| `key`               | Template key in `bot_templates.yml`. |
| `name`              | Internal readable name.              |
| `displayName`       | NPC display name.                    |
| `botType`           | `NORMAL`, `CPVP`, or `DUMMY`.        |
| `targetBindingMode` | `REQUIRED`, `NONE`, or `BOT`.        |
| `deathMode`         | `REMOVE` or `RESPAWN`.               |
| `killMode`          | `DESPAWN`, `RESPAWN`, or `NONE`.     |
| `respawnDelayTicks` | Respawn delay in ticks.              |
| `warmupTicks`       | Warm-up duration in ticks.           |
| `behavior`          | Behavior view.                       |
| `combat`            | Normal combat view.                  |
| `inventory`         | Inventory/armor/trim view.           |
| `cpvp`              | Public CPvP view.                    |
| `skin`              | Public skin view.                    |

## Behavior view

Includes:

* `guiAllowed`
* `pvpEnabled`
* `lookAtTarget`
* `followTarget`
* `randomWalk`
* `holdShield`
* `useShield`
* `resistance`
* `frozen`
* `shieldInMainHand`

## Combat view

Includes:

* `strafe`
* `wTap`
* `sTap`
* `crits`
* `shieldBreaker`
* `retreat`
* `reachMode`
* `aggression`
* `critChance`
* `critSpeed`

Mode values are integer-coded in API v1 for compatibility with the internal template model. Display them in your UI carefully or map them to your own labels.

## Inventory view

Includes:

* armor material strings
* armor enchant strings
* offhand type
* totem count
* custom main-hand material name
* armor trim pattern/material values

## CPvP view

Includes:

* enabled
* skill level
* aggression weight
* pearls
* mace
* golden apples
* obsidian placement
* block breaking
* strafing
* anchoring mode
* heal threshold
* low HP crystal reserve
* pearl cooldown

{% hint style="info" %}
Some detailed template CPvP fields exist in config files but are not exposed in the public `BotTemplateView.CpvpView` in API v1. Use the public view only for stable addon integrations.
{% endhint %}

## Common addon use cases

* build an admin template selector
* validate that required arena templates exist
* show template type and target mode in queue menus
* spawn bots from selected templates
* enforce arena-specific template allowlists


---

# 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://edelweiss-network.gitbook.io/practicebot/templates.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.
