TextComponent - Click Event (Expression) — SkBee

Addon: SkBee · Category: Expression · Since: 1.5.0

Syntax

[a] [new] click event to run command %string%

Description

Create a new click event to add to a text component. Supports run command, suggest command, open link, copy to clipboard, change book page, open dialog and custom payload. Open dialog and custom payload require Minecraft 1.21.6+

Examples

set {_t} to text component from "Check out my cool website"
add hover event showing "Clicky clicky to go to spawn!" to {_t}
add click event to open url "https://my.cool.website" to {_t}
send component {_t} to player

add click event to show dialog with key "some:dialog" to {_t}
add click event to run custom payload with key "some:key" with custom data {_nbt} to {_t}

View source