Skip to content
[/craft]

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

Broadcast a custom colored message in chat

/tellraw @a {text:"Server restarting soon",color:red,bold:true}

Display big center-screen text to a player

/title @a title {text:"Welcome!",color:gold,bold:true}

Show a smaller second line under a screen title

/title @a subtitle {text:"Good luck out there",color:yellow}

Display text just above the hotbar

/title @a actionbar {text:"Objective updated",color:aqua}

Deal a set amount of damage with a command

/damage @s 6 minecraft:magic

Mount the closest horse with a command

/ride @s mount @e[type=horse,limit=1,sort=nearest]