1

Help with JSON!

BonzoDoot 12/30/15 10:35 am
229
12/31/2015 11:06 am
Hello!

I've been working on making things from plugins with normal command blocks and I can't seem to figure this out... I'd like to create a command that replaces the text on a sign with whatever player has a certain scoreboard objective score. It would look something like this:

/blockdata ~ ~1 ~-2 {Text1:"{\"text\":\"Best Miner:\",\"color\":\"gold\"}",Text2:"{\"text\":\" \","extra":[{"selector":"@a[bestmine=2]"},\"color\":\"green\",\"bold\":true}"}

but it doesn't seem to work...

I think whatever is wrong with it is a silly mistake, because everything looks fine to me. Any feedback is appreciated!
Posted by
BonzoDoot
Level 20 : Expert Nerd
8

  Have something to say?

JoinSign in

5

Bertiecrafter
12/31/2015 11:06 am
Level 72 : Legendary System
oops it was selector, well my nonsense about score is just me being weird xD
1
Jmal116
12/30/2015 1:41 pm
Level 34 : Artisan System
As far as I'm aware, you don't need to put the selector inside and extra tag if you only have that one element on that line. Also, you're missing a couple quote escapes around that part and you defined the score selector slightly wrong. Try this:/blockdata ~ ~1 ~-2 {Text1:"{text:\"Best Miner\",color:gold}",Text2:"{selector:\"@a[score_bestmine_min=2]\",color:green,bold:true}"}
1
BonzoDoot
12/31/2015 10:55 am
Level 20 : Expert Nerd
Thanks! This worked.
1
Bertiecrafter
12/30/2015 12:25 pm
Level 72 : Legendary System
Maybe try to get the score tag one layer up, and remove the text tag....
You don't need the text tag and it might bug using the extra tag on an empty text tag.

Just put the score tag on the first layer.
1
notfegel
12/30/2015 12:12 pm
Level 5 : Apprentice Warrior
Or you can just install the plugin.
1

Welcome