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 2026Turns 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
- Java: yes
- Bedrock: no
- Command block: yes
- Needs cheats / OP: yes
How to use
- Open chat (T on Java).
- Paste the command and set the command you want it to run.
- Press Enter — the text appears in chat as a clickable button.
- 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}Mount the closest horse with a command
/ride @s mount @e[type=horse,limit=1,sort=nearest]