# 🥕 Pet Food

## About

Like players, pets can have a food level aka saturation. The max. saturation value depends on the **Max Saturation** [Attribute](https://nightexpress.gitbook.io/combatpets/features/pet-attributes).

Pet's saturation value decreased depends on their state (idle, walk, combat).

Saturation value can be restored with pet food.

Pets will not regenerate their health if their saturation level is low enough.

Pets can auto consume food from their inventories.

## Food & Categories

The food available for a pet is defined by food categories.

Food configuration located in the `config.yml` -> `Food` section.

You can create custom food categories and edit or remove existing ones, as well as adding and removing items from them.

You can add items with **custom model data**, **display name**, **lore**, **enchants**, etc.

Every **category** has unique **identifier**. You can use it to set the food categories available for specific [Pets](https://nightexpress.gitbook.io/combatpets/features/pet-templates).

Every **item** in category also has a unique **identifier**. You can use it to give food items to players via [Commands](https://nightexpress.gitbook.io/combatpets/general/commands).

```yaml
Food:
  raw_meat: # Category identifier. Must be unique!
    Name: Raw Meat # Category display name, for players & GUI.
    Items:
      mutton: # Item identifier. Must be unique!
        Item:
          Material: MUTTON
        Saturation: 3.5 # Amount of saturation it restores.
      chicken:
        Item:
          Material: CHICKEN
        Saturation: 2.5
  raw_fish: # Category identifier.
    Name: Raw Fish
    Items:
      custom_salmon: # Item identifier.
        Item:
          Material: SALMON
          Name: '<red>Custom Salmon</red>'
          Custom_Model_Data: 105
        Saturation: 5.0
```

## Setup Tips

### Set Pet Food

To set a food categories for a **specific pet**, go to [Pet Template](https://nightexpress.gitbook.io/combatpets/features/pet-templates) configuration(s) and add food category names to the `Saturation` -> `Food_Categories` option:

```yaml
FoodCategories:
- raw_meat
- raw_fish
```

### Disable Saturation

To disable the whole saturation system for a **specific pet**, go to [Pet Template](https://nightexpress.gitbook.io/combatpets/features/pet-templates) configuration(s) and remove the `max_saturation` [Attribute](https://nightexpress.gitbook.io/combatpets/features/pet-attributes) from the `Attributes` -> `Default` section.

### Auto Consume Food

By default, pets have to be feed by their owners to restore saturation level.

However, you can enable the **Auto Consume** feature to allow pets auto consume food from their inventory.

Go to the `config.yml` and set `AutoFoodUsage` -> `Enabled` on `true`.

Set `AutoFoodUsage` -> `At_Saturation` value to a desired value (it's recommended to keep it the same or greater than the `Saturation_Percent_To_Regen` value).

After that, pets will auto consume suitable food from their inventory when their saturation level drops below that value.

### Health Regeneration

Pet health regenration depends on the saturation value in % of max. saturation level.

By default pet must be satiated for 70% or more for natural health regeneration.

You can change this value in the `config.yml` -> `Saturation_Percent_To_Regen` option.

### Saturation Decreasing

To edit saturation decrease modifier for a **specific pet**, go to [Pet Template](https://nightexpress.gitbook.io/combatpets/features/pet-templates) configuration(s) and edit values under the `Saturation` -> `Exhaust` section:

```yaml
Exhaust:
  COMBAT: 0.04
  IDLE: 0.01
  WALK: 0.02
```

This is plain amount of saturation to consume during certain pet states on every tick (1 second).

* **COMBAT**: Amount of saturation to consume when pet inflicts or receives damage.
* **IDLE**: Amount of saturation to consume when pet is staying.
* **WALK**: Amount of saturation to consume when pet is walking.


---

# 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://nightexpress.gitbook.io/combatpets/features/pet-food.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.
