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

# Pets

> Mobs that belong to a player: tamed, claimed or given, they follow, fight, level up, evolve and can be ridden. Premium only.

> [!NOTE]
>
> **Pets are a premium feature.** On the free version every `pet:` block is dropped with a notice and the mob loads as an ordinary wild mob, so nothing else breaks. See [Licensing](https://entities.lodemc.net/licensing.md).

Any mob can be a pet: give it a `pet:` block. It is the same mob as before (same model, stats and effect lines) and it still spawns **wild** like any other. It becomes a pet the moment a player owns it, and from then on it follows them, fights for them, levels up, and can be put away and called back.

```yaml theme={null}
# Mobs/fox_spirit/fox_spirit.yml
fox_spirit:
  model: fox_spirit
  base: fox
  display: "&6Fox Spirit"
  health: 20
  damage: 3
  pet:
    tame: { item: sweet_berries, chance: 25% }   # feed a wild one to tame it
    mode: defend                   # defend | aggressive | passive - the owner can switch it
    follow: { distance: 4, teleport: 24 }
    mount: fly                     # walk | fly | none
    respawn: 60                    # seconds before it can be summoned again after dying
    inventory: 27                  # backpack slots, a multiple of 9 (0 = none)
    skins: [fox_spirit_snow, { model: fox_spirit_ember, name: Ember, permission: pets.skin.ember }]
    food:
    - { item: sweet_berries, heal: 4, xp: 5 }
    - { item: golden_apple, heal: 20, effects: ["potion{type=REGENERATION;duration=200} @self"] }
    levels: { max: 20, xp: 100, growth: 1.25, kill-xp: 10, health: 2, damage: 0.5 }
    evolve: { into: fox_spirit_elder, level: 10 }
    signals:
      howl: { name: "Howl", icon: goat_horn }
  effects:
  - sound{s=entity.wolf.howl}      +onSignal:howl
  - particle{p=heart;a=8}          +onPetSummon
  - narrate "&6*grows stronger*"   +onPetLevelUp @trigger

fox_spirit_elder:
  model: fox_spirit_elder
  base: fox
  health: 40
  pet: true                        # a pet with every default
```

Every field is explained in [Pet Settings](https://entities.lodemc.net/pet-settings.md).

## Getting one

There are three ways, and they all end in the same collection:

* **Taming.** Right-click a wild one while holding its `tame.item`. Each try spends the item (`consume: false` keeps it) and succeeds with `chance`. On success, that very mob becomes yours where it stands, with hearts above it. On failure it puffs smoke and its `+onTameFail` lines run. Vanilla taming never applies to a mob with a `pet:` block.
* **Permission.** `permission: some.node` puts the pet in the menu of anyone with that node, ready to claim with one click.
* **Command.** `/le pets give <player> <mob>` adds one to a player's collection. It works from the console, so a store, a crate or a quest plugin can hand pets out.

`pets.max-owned` in `config.yml` caps how many pets one player can own.

## The pets menu

**`/le pets`** opens a player's collection. Every player can use it; there's no permission to grant.

| Click | What happens |
| :- | :- |
| Left-click a pet | Summons it, or puts it away if it's out. |
| Right-click a pet | Opens that pet's own menu. |
| A pet marked **Yours to claim** | Adopts it (by permission) and summons it. |
| **Put all away** | Sends every pet that's out home. |

Each pet's own menu has **Summon / Put away**, **Ride**, its fighting **Mode**, **Rename**, **Skins**, **Backpack**, a button for each **signal**, and **Release** (shift-click to confirm; anything in its backpack is handed to you first).

Owners can also **right-click their pet** in the world: holding something it eats feeds it, anything else opens its menu. Other players can't ride, feed or open somebody else's pet.

The menus use the same art, overlay and button textures as the [Entities menu](https://entities.lodemc.net/gui.md).

## Out in the world

A pet:

* **Follows** its owner. It walks back once it is more than `follow.distance` away. Past `follow.teleport`, or when the owner changes world, it teleports beside them.
* **Fights** according to its mode:
  * **Defend** (the default) takes on whatever hurts its owner or itself.
  * **Aggressive** also joins whatever its owner hits, and picks fights with monsters within 12 blocks.
  * **Passive** never fights.
* **Uses threat** like every mob, so it never targets an ally. A pet is always an ally of its owner and of that owner's other pets, whatever `factions.yml` says. See [Factions & Threat](https://entities.lodemc.net/factions-threat.md).
* **Attacks** with its base entity's own attack when it has one (wolves, foxes, zombies). Otherwise it gets a plain melee hit, so a pet pig on defend still bites.
* **Is safe from its owner.** The owner can't hurt it (unless `pets.owner-can-hurt` is on), and it never hurts the owner.
* **Is never saved with the chunk.** It only exists beside an owner who is online. Logging off puts it away and logging back on brings it back. A pet lost to an unloading chunk is summoned back to its owner.
* **Is left alone by `/le killall`**, so a cleanup never takes someone's pet.

`pets.max-active` decides how many can be out at once; summoning one more puts the oldest away.

## Riding

With `mount: walk` or `mount: fly`, the **Ride** button in the pet's menu puts the owner on it.

* A model with a seat bone (`p_…`, see [Bone Tags](https://entities.lodemc.net/bone-tags.md)) is ridden on that seat with the engine's own walk and fly controls.
* Any other pet is ridden as a plain passenger: movement keys move it, jump hops (walk) or climbs (fly), and a flying pet goes where you look.
* Sneak to get off. `mount-speed` multiplies its speed while ridden.
* Only the owner can ride it, and only from the menu.

## Levels and evolving

A pet earns experience from kills (`kill-xp`) and from food (`xp`). Reaching level 2 costs `xp`, and each level after costs `growth` times the one before. Every level above 1 adds the per-level `health`, `damage`, `armor` and `speed` on top of the mob's own stats. `<caster.level>` and the `level` [condition](https://entities.lodemc.net/conditions.md) read the pet's level.

With `evolve`, the pet turns into the `into` mob when it reaches that level, where it stands, and keeps its name, level, experience and backpack. The `into` mob needs a `pet:` block of its own. A pet that grows through a mob's [`aging`](mob-aging) chain stays the same pet too.

## Dying

A pet that dies drops nothing and goes back to the collection, keeping its backpack. It can be summoned again after `respawn`, at full health; the menu shows how long is left.

## Skins and signals

**Skins** are other models the owner can dress the pet in from its menu. Each one can need a permission; locked ones show as locked.

**Signals** are menu buttons that fire the pet's `+onSignal:<name>` lines, with the owner as `@trigger`: a howl, a trick, a special attack on command. Every signal the pet's lines listen for gets a button even when `signals:` doesn't list it; listing one only sets its label and icon.

## Pet triggers

The mob's own effect lines can react to pet life:

| Trigger | Fires when | `@trigger` is |
| :- | :- | :- |
| `+onTame` | a player tames it | the new owner |
| `+onTameFail` | a taming attempt fails | the player |
| `+onPetSummon` | it is summoned | the owner |
| `+onPetDismiss` | it is put away | the owner |
| `+onPetFeed` | its owner feeds it | the owner |
| `+onPetLevelUp` | it gains a level; `<skill.var.level>` is the new level | the owner |
| `+onPetEvolve` | it evolves | the owner |
| `+onSignal:<name>` | its menu button is pressed | the owner |

`@owner` and `@ownerLocation`, and the `hasOwner` and `ownerIsOnline` conditions, work on pets the same way they do on any owned mob.

## Where collections are saved

Each player's pets are saved in `plugins/LodeEntities/pets/<uuid>.yml`: names, levels, experience, mode, skin, health and backpack. It's a plain YAML file, so staff can read it or fix it by hand while that player is offline. Collections are saved when their owner logs off, when the server stops, and every `pets.autosave` seconds in between.

After a `/le reload`, a pet whose mob was deleted or lost its `pet:` block goes home and shows as **unavailable** in the menu. It stays in the collection, so restoring the config brings it back.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.