---
title: "Entity Events"
version: 1.26.50.26
channel: beta
source: https://bedrock.dev/docs/beta/Entity%20Events
---

> Documentation index: https://bedrock.dev/llms.txt
> Append `.md` to any /docs/stable/ or /docs/beta/ URL for markdown.

<h1>ENTITY EVENTS DOCUMENTATION </h1>
<p>This is documentation for a preview release of Minecraft. New features, components, and capabilities in this release are not final and might change without notice before the final release.<br/>Be sure to check the documentation once the release is out of preview if your add-on isn't working properly. Resource and Behavior Packs created for the preview are not guaranteed to work on the final release.<br/></p>
<h2><p id="Index">Index</p></h2>


<h1><p id="This describes the structure of the Events section.">This describes the structure of the Events section.</p></h1>

<br>

<h1><p id="Overview">Overview</p></h1>

<p></br>		Entity events can be structured by a combination of 'sequence' and 'randomize' nodes.</br>		'sequence' nodes are array nodes and will execute all entries in order from first element to last.</br>		'randomize' nodes are array nodes that will pick one entry to execute, based on a weight.</br>		'filters' can also be added within 'sequence' and 'randomize' nodes to restrict execution.</br></br>		Within 'randomize' and 'sequence' nodes, you can specify a few operations.</br>		'trigger', 'filters', 'add', and 'remove'.</br>		You can read about 'filters' in the 'Filters' section of the documentation.</br>		'trigger' can be used to fire additional entity events when an event is hit.</br>		'add' can be used to add component groups to your entity.</br>		'remove' can be used to remove component groups from your entity.</br></br>		When an event is received, the effects of that event are determined immediately, but those changes</br>		are not applied to the entity until the entity ticks on the server side of the game. This means</br>		filters in later entries in a 'sequence' array won't see changes from earlier in that array.</br>		It also means that when one entity sends an event to another entity, it could take effect on the same</br>		game tick or on the next tick, depending on whether the target entity has already been updated.</br>	</br><br></p>

<h1><p id="Versioned Changes">Versioned Changes</p></h1>

<p></br>		A 'format_version' of '1.19.20' or higher is required to properly evaluate filters specified on an entity event definition</br>		at the root level of the event, that is any filter that is not underneath a 'sequence' or 'randomize' node.</br>		Content with a lower version will use the old behavior, which was to ignore root level filters.</br>	</br><br></p>

<h1><p id="Randomize Node">Randomize Node</p></h1>

<p></br>		The 'randomize' node is an array node that will pick one entry to execute, based on a weight.</br>		If no weight is specified, a node will have a weight of 1.0.</br>		If you add a weight of 4.0 in one node, and 8.0 in another, then those nodes will have a 33.33% (4 / (4 + 8)) and 66.66% (8 / (4 + 8)) chance of executing, respectively.</br>	</br>
Example:<br / ></p>

```json
"randomize": [
      {
        "weight": <float>
        // actions like 'add' or 'remove'
      }
    ]
```

 </br>
<br>

<h1><p id="Sequence Node">Sequence Node</p></h1>


<p>Example:<br / ></p>

```json
"sequence": [
      {
        // I will execute first! c:
      },
      {
        // I will execute last! :c
      }
    ]
```

 </br>
<br>

<h1><p id="Trigger">Trigger</p></h1>

<p>Triggers additional entity events when hit. For example, you could use a randomize node in minecraft:entity_spawned to choose either an adult or baby event for adding component groups.</br>
Example:<br / ></p>

```json
"sample:spawn_adult": {
      // add adult component groups
    },
    "sample:spawn_baby": {
      // add baby component groups
    },
    "minecraft:entity_spawned": {
      "randomize": [
        {
          "weight": 50.0,
          "trigger": "sample:spawn_adult"
        },
        {
          "weight": 50.0,
          "trigger": "sample:spawn_baby"
        }
      ]
    }
```

 </br>
<br>

<h1><p id="Add Component Group">Add Component Group</p></h1>

<p>Adds component groups to the current entity. These groups must be defined in the 'component_groups' section of the file. As entities can only have one component of each type active, any components in a group that is being added will replace previously added components. Additionally, adding a component group that is already active will cause those components to be re-initialized. For some types of components like minecraft:is_baby, re-initializing an already active component has no effect, but for other component types the associated logic will start over. For example, an already-added minecraft:timer that is added again will start its timing logic over.</br>
Example:<br / ></p>

```json
"sequence": [
      {
        "add": { "component_groups": [ "one" ] }
      },
      {
        "add": { "component_groups": [ "two", "five", "etc.." ] }
      }
    ]
```

 </br>
<br>

<h1><p id="Remove Component Group">Remove Component Group</p></h1>

<p>Removes component groups from the current entity. This can be any group you have defined in the 'component_groups' section of the file.</br>
Example:<br / ></p>

```json
"sequence": [
      {
        "remove": { "component_groups": [ "one" ] }
      },
      {
        "remove": { "component_groups": [ "two", "five", "etc.." ] }
      }
    ]
```

 </br>
<br>

<h1><p id="Set Entity Property">Set Entity Property</p></h1>

<p>Sets the value of an entity property. The property must be defined in the 'properties' section of the file. </br>
Example:<br / ></p>

```json
"set_property": {
      "minecraft:has_nectar": false
    }
```

 </br>
<br>

<h1><p id="Queue Command">Queue Command</p></h1>

<p>Queues a command to be run on the entity. The command will run within the next tick unless the entity has been removed.</br>
Example:<br / ></p>

```json
"queue_command": {
      "command": "say I have died!"
    }
```

 </br>
<br>

