Commands let players perform actions and customize gameplay using text-based instructions. Use this topic to share feedback and ideas for improving commands and related tools.

3

/tellraw clickEvent trigger score (Make clickEvent use JSON components)

1 Comments

Post a new comment:

Please sign in to leave a comment.

Sorted by oldest
  • 1
    Registered User commented
    Comment actions Permalink

    You are very close. This is possible, but your approach was incorrect.

    Instead of the value field being another JSON text component, try setting the inner command to /tellraw and including JSON inside the value. Like this:

    tellraw @a
    {
    "text":"Click to Show Health",
    "clickEvent":{
    "action":"run_command",
    "value":"/tellraw @s [{\"text\":\"My health is\"},{\"score\":{\"name\":\"@s\",\"objective\":\"health\"}}]"
    }
    }