Skip to content
[/craft]
Clickable Chat Text That Runs a Command

Clickable Chat Text That Runs a Command

Make chat text a clickable button that runs a command

✅ Verified for Java 26.2 · Bedrock 26.32 — checked June 2026

Turns a chat message into a clickable link that runs a command, opens a URL, or copies text. On current Java the interactivity lives in the click_event object (e.g. click_event:{action:run_command,command:"/spawn"}); other actions include open_url, copy_to_clipboard, and suggest_command. Pair it with hover_event:{action:show_text,value:"..."} to show a tooltip on hover.

/tellraw @a {text:"[Click to teleport to spawn]",color:green,click_event:{action:run_command,command:"/spawn"}}
111 characters

How to use

  1. Open chat (T on Java).
  2. Paste the command and set the command you want it to run.
  3. Press Enter — the text appears in chat as a clickable button.
  4. Players click it to run the command (they need permission for that command).

Related commands