> For the complete documentation index, see [llms.txt](https://docs.creoii.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.creoii.dev/creo-api/packages/food-component-api.md).

# Food Component API

## Setup

{% tabs %}
{% tab title="Gradle" %}

```gradle
repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-food-component-api:<VERSION>'
}
```

{% endtab %}

{% tab title="Kotlin" %}

```gradle
repositories {
    mavenCentral()
}

dependencies {
    modImplementation("dev.creoii.creoapi:creo-food-component-api:<VERSION>")
}
```

{% endtab %}
{% endtabs %}

## CreoFoodComponent

An extension of **FoodComponent** that provides even more customizability for food.

```java
// How fast it takes to eat the food item.
private final int eatSpeed;

// Provides a durability bar which decreases each time you eat the food item.
private final int eatDurability;

// Whether the food item can be eaten while sprinting.
private final boolean sprintEdible;

// Whether the food heals health or hunger.
private final boolean healsHealth;
```
