mojira.dev
MC-277308

/tellraw "clickEvent" only excepts singular String

The "clickEvent" option of "/tellraw" components only allows for single strings instead of json compounds as its "value". This is unexpected because both the "/tellraw" command itself and the thematically similar and structurally identical "hoverEvent" component both do support json compounds alongside singular strings.

Thus, not only can't simple strings be combined for a "clickEvent", but also scores from scoreboards, translation keys, entity selector and nbt data from for example storages (see the examples below) cannot be employed.

Setup:

/data modify storage example message set value 'Hello World!'

 

/tellraw:

# Singular String works:
/tellraw @p "Message!"

# Compound works:
/tellraw @p ["Message: ",{"nbt":"message","storage":"example","interpret":false}]

/tellraw hoverEvent:

# Singular String works:
/tellraw @p {"text":"Hover here","hoverEvent":{"action":"show_text","value":"Message!"}}

# Compound works:
/tellraw @p {"text":"Hover here","hoverEvent":{"action":"show_text","value":["Message: ",{"nbt":"message","storage":"example","interpret":false}]}}

/tellraw clickEvent:

# Singular String works:
/tellraw @p {"text":"Click here","clickEvent":{"action":"suggest_command","value":"Message!"}}

# Compound doesn't work:
/tellraw @p {"text":"Click here","clickEvent":{"action":"suggest_command","value":["Message: ",{"nbt":"message","storage":"example","interpret":false}]}}

The latter command results in the following error message:

Invalid chat component: Not a string: [...]

 

 

Attachments

Comments 1

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryThe official Minecraft feedback site

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

E_T_31

(Unassigned)

Confirmed

Commands

1.21.1, 24w40a

Retrieved