/scriptevent Command in Minecraft Bedrock Edition

Trigger Custom Script Events With Commands

Bedrock EditionLogic & ScoreboardPermission: Game DirectorsCheats: Yes

The /scriptevent command causes an event to fire within a script using a specified message ID and data payload. It allows you to pass custom information directly to the scripts running inside your world's installed behavior packs.

Creators and map makers use this command to connect scripting with any location where commands are used. This is helpful when you want a command block or player action to trigger custom logic defined in your add-on files.

Syntax (1 form)

  1. /scriptevent <messageId: string> <message: message>

    Send script event message

Arguments

ArgumentTypeWhat it means
messagemessageData component of the message to send. This is custom and dependent on the kinds of behavior packs and content you may have installed within the world. Message may not exceed 2048 characters in length.
messageIdstringIdentifier of the message to send. This is custom and dependent on the kinds of behavior packs and content you may have installed within the world.

Examples

Tips

Common mistakes

Bedrock vs Java

Minecraft Java Edition does not have a /scriptevent command, as this feature is exclusive to the Bedrock Edition scripting system.

FAQ

What is the character limit for the /scriptevent message?

The message payload argument cannot exceed 2048 characters in length.

Why does nothing happen when I run /scriptevent?

The command only fires an event that installed behavior packs can listen for, so nothing will happen if your world does not have an active script programmed to respond to that exact message ID and payload.

Can I use /scriptevent in Minecraft Java Edition?

No, Java Edition has no command with this name; it is only available in Minecraft Bedrock Edition when cheats are enabled.

Related commands

/dialogue/execute/function/packstack/reload/reloadpacketlimitconfig/schedule/scoreboard/sendshowstoreoffer/tag/testfor/testforblock/testforblocks/toggledownfall