2

I need help with a command that I am trying to make in a game inside of minecraft. It is a custom generated sign (using a sign generator) that allows players to upgrade their weapons (and armor).

The command is the following:

/give @p sign 1 0 {BlockEntityTag:{Text1:"{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins=24] ~ ~ ~ /tellraw @p [\\"\\",{\\"text\\":\\"[MF2] \\",\\"color\\":\\"gold\\"},{\\"text\\":\\"[SHOP] \\",\\"color\\":\\"yellow\\"},{\\"text\\":\\"You do not have enough wins to upgrade your sword.\\",\\"color\\":\\"none\\"}]\"}}",Text2:"{\"text\":\"Upgrade Sword\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /tellraw @p [\\"\\",{\\"text\\":\\"[MF2] \\",\\"color\\":\\"gold\\"},{\\"text\\":\\"[SHOP] \\",\\"color\\":\\"yellow\\"},{\\"text\\":\\"Sword upgraded!\\",\\"color\\":\\"none\\"}]\"}}",Text3:"{\"text\":\"$25\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /scoreboard players add @p sword 1\"}}",Text4:"{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /scoreboard players remove @p wins 25\"}}"},display:{Name:"Custom Sign"}}

The first line of the sign is empty, and the click-event runs an execute command that tells the player that they do not have enough wins to upgrade using a tellraw statement.

The second line of the sign says "Upgrade Sword", and the click-event runs an execute command that tells the player that they have enough wins and their sword has been upgraded using a tellraw statement.

The third line of the sign says "$25" (which is the amount of wins to upgrade), and the click-event runs an execute command that increments the "sword" scoreboard for the player by 1.

The fourth line of the sign is empty, and the click-event runs an execute command that subtracts 25 wins from the player using the "wins" scoreboard.


My error is displayed as shown:

Data tag parsing failed: Unexpected token '\' at: \\",{\\"text\\":\\"[MF2] \\",\\"color\\":\\"gold\\"},{\\"text\\":\\"[SHOP] \\",\\"color\\":\\"yellow\\"},{\\"text\\":\\"You do not have enough wins to upgrade your sword.\\",\\"color\\":\\"none\\"}]\"}}",Text2:"{\"text\":\"Upgrade Sword\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /tellraw @p [\\"\\",{\\"text\\":\\"[MF2] \\",\\"color\\":\\"gold\\"},{\\"text\\":\\"[SHOP] \\",\\"color\\":\\"yellow\\"},{\\"text\\":\\"Sword upgraded!\\",\\"color\\":\\"none\\"}]\"}}",Text3:"{\"text\":\"$25\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /scoreboard players add @p sword 1\"}}",Text4:"{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /scoreboard players remove @p wins 25\"}}"

I have a similar command creating a custom sign again and the problem seems to be the tellraw commands. You can find my other question here.

I have tried using the answer from my other question to fix this command but I have just gotten completely lost. If anyone could help or explain to me how to use this properly (because I will also need to do this for other items), that would be fantastic.

  • If you were using a 1.9 generator with Minecraft 1.8 that could have been your problem. 1.8 can work with 1.9, but 1.9 can't work with 1.8. – Jason_ Apr 4 '16 at 2:27
  • @Jason_ That is incorrect. In 1.9, JSON must be strict. In 1.8, JSON can be strict. If you have lenient JSON from 1.8, it won't work in 1.9 because in 1.9 it must be strict. But 1.9 JSON will work perfectly in 1.8. – Skylinerw Apr 4 '16 at 3:10
  • @Skylinerw, woops, sorry guess I didn't do my homework properly. Thanks for the clarification. – Jason_ Apr 4 '16 at 5:02
2

I was smart before writing this huh... I only used one generator to try and make the command. As soon as I posted this I was like "hey lets try another one" and it worked. This is the working command:

/blockdata ~ ~1 ~ {Text1:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins=24] ~ ~ ~ /tellraw @p [\\"\\",{\\"text\\":\\"[MF2] \\",\\"color\\":\\"gold\\"},{\\"text\\":\\"[SHOP] \\",\\"color\\":\\"yellow\\"},{\\"text\\":\\"You do not have enough wins to upgrade your sword.\\",\\"color\\":\\"none\\"}]\"},\"text\":\"\"}]",Text2:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /tellraw @p [\\"\\",{\\"text\\":\\"[MF2] \\",\\"color\\":\\"gold\\"},{\\"text\\":\\"[SHOP] \\",\\"color\\":\\"yellow\\"},{\\"text\\":\\"Sword upgraded!\\",\\"color\\":\\"none\\"}]\"},\"text\":\"Upgrade Sword\"}]",Text3:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /scoreboard players add @p sword 1\"},\"text\":\"25 Wins\",\"color\":\"green\"}]",Text4:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/execute @p[score_wins_min=25] ~ ~ ~ /scoreboard players remove @p wins 25\"},\"text\":\"\"}]"}

Well, I guess that solves that.

//Edit: The link to the generator I used is by MCtoolBox, and you can go straight to the sign generator by clicking here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.