Minecraft – Custom tellraw url in Minecraft

minecraft-commandsminecraft-java-edition

I need to have a commandblock output a clickable url to the chat with the playername inside of it and some scoreboard variables.

Example:

http://example.com/?player=<INSERT PLAYERNAME HERE>&variable1=<INSERT SCOREBOARD VARIABLE Here>

is there any way to do this?

Best Answer

As far as I know, this is impossible. The "value" field of a "clickEvent" object can only be a simple string, not another JSON object itself. There seems to also be no other way of piecing together e.g. something to be copied to the player's clipboard.

The best you can do is to just output the link to chat as text:

/tellraw @p [{"text":"https://gaming.stackexchange.com/users/"},{"score":{"name":"@p","objective":"number"}}]

When this is executed, a line similar to this one appears in the targeted player's game log:

[03:32:08] [Render thread/INFO]: [CHAT] https://gaming.stackexchange.com/users/171580

In some text editors the player can then e.g. double-click on the link, in others the link needs to be copied and pasted into a browser.

Related Topic