Commands/event

Minecraft Wiki article. Categories: Bedrock_Edition, Minecraft_Education, Commands

📌 Mirrored from Minecraft Wiki

This article is reproduced from Commands/event on the Minecraft Wiki. Mirrored from revision 3187541. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.

This feature is exclusive to Bedrock Edition and Minecraft Education.
 
/event

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

CommandTriggerBedrock Edition
AnyThe 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.
OtherwiseSuccessful

Output

CommandEditionSituationSuccess Count
AnyBedrock EditionOn fail0
On successthe number of types of entities that is executed entity event

History

Bedrock Edition
1.16.100beta 1.16.100.57Added /event.

Sources