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

# Pet Definition

# Pet Definition

**Type:** `pet_definition`

Defines a species of pet. This includes its default appearance, leveling progression, and combat settings.

## Configuration

| Field         | Type                               | Default | Description                                   |
| :------------ | :--------------------------------- | :------ | :-------------------------------------------- |
| `id`          | String                             | ""      | Unique identifier.                            |
| `description` | String                             | ""      | Internal description.                         |
| `texture`     | String                             | ""      | Base64 texture for HEAD mode.                 |
| `npc`         | Ref\<EntityDefinition>             | Empty   | Entity definition for GROUND mode or skin.    |
| `skins`       | List\<Skin>                        | \[]     | List of alternative skins.                    |
| `defaultMode` | Enum                               | HEAD    | `HEAD` (floating) or `GROUND` (walking).      |
| `headOffset`  | Vector                             | Zero    | Offset for floating head position.            |
| `xp`          | [XpSettings](#xp-settings)         | ...     | Leveling configuration.                       |
| `combat`      | [CombatSettings](#combat-settings) | ...     | Retaliation configuration.                    |
| `token`       | [TokenSettings](#token-settings)   | ...     | Appearance of the item representing this pet. |

## Xp Settings

| Field        | Type         | Default | Description                                  |
| :----------- | :----------- | :------ | :------------------------------------------- |
| `formula`    | String       | ""      | Expression using `{level}` for XP per level. |
| `levels`     | List\<Level> | \[]     | Explicit per-level requirements.             |
| `maxLevel`   | Int          | 10      | Maximum achievable level.                    |
| `killReward` | Int          | 0       | XP gained when owner kills a mob.            |

## Combat Settings

| Field     | Type    | Default | Description                        |
| :-------- | :------ | :------ | :--------------------------------- |
| `enabled` | Boolean | false   | Whether the pet attacks attackers. |

## Token Settings

| Field  | Type          | Default    | Description               |
| :----- | :------------ | :--------- | :------------------------ |
| `item` | Item          | PlayerHead | Icon used in menus/items. |
| `name` | String        | "{name}"   | Display name.             |
| `lore` | List\<String> | ...        | Item lore.                |
| `glow` | Boolean       | false      | If the item glows.        |
