/event
< Commands
This feature is exclusive to Bedrock Edition and Minecraft Education.
/event| Permission level required |
1 |
|---|---|
| Restrictions |
Cheat only |
{
"title": "<code>/event</code>",
"rows": [
{
"field": "1",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "(link to Option article, displayed as Cheat) only<br>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Used to trigger an event on an entity.
Syntax
event entity <target: target> <eventName: string>
Arguments
target: target: CommandSelector<Actor>
- Must be a player name or a target selector.
- Specifies the target(s) to execute an entity event.
eventName: string: basic_string
- Specifies the in-game event for the entity. Should be a spawn event (event name for entities in behavior pack).
- Must be a string. And it must be a single word that has no space or a double-quoted string (When quoted,
\can be used to escape characters).
Result
| Command | Trigger | Bedrock Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable |
target: target fails to resolve to one or more entities (named players must be online). | Failed | |
| All selected entities don't have this specified events declared in the events section of the entity definition file. | ||
| Otherwise | Successful |
Output
| Command | Edition | Situation | Success Count |
|---|---|---|---|
| Any | Bedrock Edition | On fail | 0 |
| On success | the number of types of entities that is executed entity event |
History
| Bedrock Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.16.100 | beta 1.16.100.57 | Added /event. | |||||