GameplayBedrockEducation

/scriptevent

Fires a custom script event with a namespaced ID and a message string, picked up by the Bedrock Scripting API (system.afterEvents.scriptEventReceive). The bridge between commands/command blocks and addon scripts.

What is /scriptevent used for?

What /scriptevent is for

Fires a custom script event with a namespaced ID and message, picked up by the Bedrock Scripting API.

When to use /scriptevent

Bridge command blocks and addon scripts — the script listens via scriptEventReceive and reacts to the message.

Syntax

Parameters

messageId
namespaced ID
Event ID, e.g. mypack:hello.
message
string
Payload string passed to the script.

Examples

  • Tell the addon script to start round 1.

Permission level

/scriptevent requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.