Making a command that outputs a tellraw link
Cyahnide opened this issue ยท 6 comments
Hello,
So I decided to take a crack at it and make myself a simple command.
I was following the the example of the god script.
This is my script.
{
"name": "site",
"usage": "/site",
"extraPermissions": {},
"patterns": {
"": [
"$/tellraw @p Visit ["",{"text":"mysite","underlined":true,"clickEvent":{"action":"open_url","value":"http://mysite.net"}}] for more info!"
]
},
"aliases": []
}
This works when I put it in a command block, but when I put it in in a command, it doesn't work.
Doing that outputs this
Invalid json: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8
You probably just didn't escape the json properly.
It should be
"$/tellraw @p Visit [\"\",{\"text\":\"mysite\",\"underlined\":true,\"clickEvent\":{\"action\":\"open_url\",\"value\":\"http://mysite.net\"}}] for more info!"
]
Check server console for errors when starting the server.
If it could not parse the json correctly, the command will not be registered and you will get a message telling you that if you try to use it.
Does this happens when the command is ran or when it is loaded with fereload?
Use http://jsonlint.com/ for example to make sure your json is correct.