> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edpets/core/animations.md).

# Grind Animations

`animations.yml` makes pets **hold and swing tools while their owner grinds**: a pickaxe while mining in PinnaPrison/EdPrison, a pickaxe or hoe depending on the EdTools zone, a sword while fighting in EdDungeons — or anything you invent.

```yaml
settings:
  swing-cooldown-millis: 250          # min time between swings per pet
  revert-held-item-after-millis: 5000 # revert to the pet's default held item after idling (0 = never)

profiles:
  edtools-farming:
    sources:                          # grind source ids this profile reacts to
      - 'edtools-break-crop-tool'
    held-item: DIAMOND_HOE            # material, texture-<base64> or none
    swing: MAIN_HAND                  # MAIN_HAND, OFF_HAND or NONE
    model-animation: 'attack'         # played instead for model pets
    # pets: [dragon]                  # optional: restrict to specific pet types
```

## How it works

When a grind event fires, the matching profile:

1. Puts `held-item` in the pet's hand (armor-stand pets) — reverting to the pet's `display.held-item` after `revert-held-item-after-millis` of no grinding.
2. Plays the arm **swing** (rate-limited by `swing-cooldown-millis`).
3. For **model pets**, plays `model-animation` (an animation folder of the model) instead.

Notes:

* `display.swing-on-grind: false` on a pet opts it out entirely.
* `display.swing-animation: false` in `config.yml` is the master switch.
* `item-display` pets have no arms/equipment — animations are skipped for them.

## Shipped profiles

`pinnaprison-mining`, `edtools-mining` (pickaxe), `edtools-farming` (hoe), `eddungeons-combat` (sword), `edprison-mining` (pickaxe).

## From the API

Third-party plugins can trigger a profile directly:

```java
EdPetsAPI.getInstance().getVisualsAPI().playGrindAnimation(player, "my-source-id");
EdPetsAPI.getInstance().getVisualsAPI().setHeldItemOverride(player, itemStack); // manual override
```
