> For the complete documentation index, see [llms.txt](https://itemsadder.devs.beer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://itemsadder.devs.beer/adding-content/entities/events-and-actions.md).

# Events and Actions

Make your entities more interactive by performing actions when specific events occur. This is similar to the custom items events and actions.

{% hint style="info" %}
New actions and events will be implemented in the future. This is a new feature so it's still a work in progress.
{% endhint %}

## Events

### `attack`

Actions executed when a custom entity attacks another entity.

### `attacked`

Actions executed when a custom entity is attacked by another entity.

### `damaged`

Actions executed when a custom entity takes damage.

### `death`

Actions executed when a custom entity dies.

### `interact`

Actions executed when a player interacts with a custom entity.

## Actions

### `execute_command`

Execute a command.

* `command` the command to execute
* `as_console` if the command must be executed as console (true by default)
* `silent` if the command must send a message or not on execution
* `flow_success_if_message_contains` The plugin can't automatically identify plugins commands success/fail status, so you have to specify a text that can help the plugin to identify the command status.

### `summon_entity`

Summon a custom entity.

* `entity` the entity ID
* `max_per_chunk` the max amount of entities of this type to be allowed to spawn in the current chunk

### `script`

Run a [script](https://itemsadder.devs.beer/plugin-usage/scripting).

* `name` the name of the script to execute. Example: `example:my_script`

### Common action properties

#### `delay`

Delay before executing this action.

#### `flow`

Advanced options to change the flow of actions for this event section.\
Refer to the [VSCode extension](/plugin-usage/beginners/files-editor.md) to get more info.

#### `permission`

Permission required to run this action.


---

# 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://itemsadder.devs.beer/adding-content/entities/events-and-actions.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.
