> 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/events.md).

# Events

## Setup

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

```gradle
repositories {
    mavenCentral()
}

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

{% endtab %}

{% tab title="Kotlin" %}

```gradle
repositories {
    mavenCentral()
}

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

{% endtab %}
{% endtabs %}

## Block Events

**BlockEvents.PLACE:** Fired when a block is placed.\
**BlockEvents.BREAK:** Fired when a block is broken.\
**BlockEvents.CHANGE:** Fired when a block changes at a position.

**CropEvents.GROW:** Fired when a crop grows naturally or when bone-mealed.

## Entity Events

**AnimalEntityEvents.PRE\_BREED:** Fired when two Animals breed, before the baby is born.\
**AnimalEntityEvents.POST\_BREED:** Fired when two Animals breed, after the baby is born.\
**AnimalEntityEvents.EAT:** Fired when an animal is fed food.\
**AnimalEntityEvents.GROW\_UP:** Fired when a baby animal grows up.\
**AnimalEntityEvents.LOVE:** Fired when two animals have entered 'love' mode to begin breeding.

**EntityEvents.SPAWN:** Fired when an Entity spawns in the world.\
**EntityEvents.WITHIN\_STRUCTURE:** Fired when an Entity is within a structure.\
**EntityEvents.DATA\_TRACK:** Fired when an Entity's tracked data is set. (Removed in 0.4.0)\
**EntityEvents.WRITE\_NBT:** Fired when an Entity's NBT is written. (Removed in 0.4.0)\
**EntityEvents.STRUCK\_BY\_LIGHTNING:** Fired when an entity is struck by a lightning bolt.\
**EntityEvents.CHANGE\_DIMENSION:** Fired when an entity moves to another dimension. This is not called for players.

**LivingEntityEvents.DROP\_LOOT:** Fired when a living entity drops loot on death.\
**LivingEntityEvents.EQUIP\_STACK:** Fired when a living entity equips an equipment item.\
**LivingEntityEvents.EAT\_FOOD:** Fired when a living entity eats food.

**MobEntityEvents.INITIALIZE:** Fired when a mob is initialized into the world.\
**MobEntityEvents.INIT\_GOALS:** Fired when a mob has its goalSelector and targetSelector initialized.

**PlayerEntityEvents.LEVEL\_UP:** Fired when a player levels up.\
**PlayerEntityEvents.RESPAWN:** Fired when a player respawns.

**ProjectileEntityEvents.FIRE:** Fired when a projectile is fired.\
**ProjectileEntityEvents.IMPACT:** Fired when a projectile impacts something.

## Item Events

**ItemEvents.CRAFT:** Fired when an item is crafted.\
**ItemEvents.ENCHANT:** Fired when an item is enchanted.\
**ItemEvents.PICK\_UP:** Fires when an item is picked up by a player or mob.

## World Events

**WorldEvents.EXPLODE:** Fired when an explosion occurs in the world.

## Misc Events

**FishingEvents.CAST:** Fired when a Fishing Rod is cast.\
**FishingEvents.REEL\_IN:** Fired when a Fishing Rod has its Fishing Bobber reeled in.

**SleepEvents.EXPLODE:** Fired when a Bed explodes.\
**SleepEvents.SLEEP:** Fired when an entity attempts to sleep in a Bed.\
**SleepEvents.WAKE\_UP:** Fired when an entity wakes up from a Bed.

**LanguageEvents.LOAD\_TRANSLATION:** Fired when each translation key for a locale is translated and stored.

**RecipeEvents.RECIPE\_LOAD:** Fired when a recipe is deserialized, before being loaded into the game.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.creoii.dev/creo-api/packages/events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
