1

Problem with JSON, sign and open_url function

TheRedSkorpion's Avatar TheRedSkorpion6/23/14 12:06 am
6/23/2014 4:51 pm
TheRedSkorpion's Avatar TheRedSkorpion
So I was messing around with setblock command (all in latest snapshot). My goal is to make a sign with 4 lines of text. The last line is red and has the text : "this link" (All of the text shows up correctly with the good color and stuff). I used the open_url function within "clickEvent" to open a url to planetminecraft.com.

Ref of the wiki (Raw JSON Text part): http://minecraft.gamepedia.com/Commands#Raw_JSON_Text

It's on the wiki that I got the open_url info and I don't understand why my command doesn't work, here it is:

setblock ~ ~-1 ~ minecraft:standing_sign 0 replace {Text1:"For more",Text2:"information,",Text3:"right click",Text4:"{text:\"this link\",color:dark_red,italic:true,clickEvent:{action:open_url,value:\"http://www.planetminecraft.com\"}}"}

Hope it doesn't look too messy lol. You should try it in a command block just to understand how it looks, it's not that complicated to visualize though:

For more
information,
right click
this link


Can somebody help me with fixing the open_url?
Posted by TheRedSkorpion's Avatar
TheRedSkorpion
Level 20 : Expert Engineer
10

Create an account or sign in to comment.

6

TheRedSkorpion
06/23/2014 4:51 pm
Level 20 : Expert Engineer
TheRedSkorpion's Avatar
Well thanks for helping If it's part of books and tellraw but not signs, I suppose I misunderstood the snapshot review :3
1
deadrecon98
06/23/2014 6:20 am
Level 38 : Artisan Programmer
deadrecon98's Avatar
You need to understand that JSON is a functional part of java. It is just text put into a formatted database. Minecraft then reads this data and does stuff with it. That is why action:open_url will not work. It is not part of the minecraft code therefore it doesn't get parsed.
1
nickfromgreece
06/23/2014 6:34 am
Level 54 : Grandmaster Programmer
nickfromgreece's Avatar
JSON is not part of java

its a library

http://json.org/
1
anonpmc337468
06/23/2014 8:29 am
Level 11 : Journeyman Miner
anonpmc337468's Avatar
[deleted]
1
Pepijn
06/23/2014 6:22 am
Level 57 : Grandmaster Cyborg
Pepijn's Avatar
ehmm... it's part of the mc code, it works with books (as of the latest snapshot) and has worked with /tellraw for a while now.
1
Pepijn
06/23/2014 6:05 am
Level 57 : Grandmaster Cyborg
Pepijn's Avatar
I don't believe open_url works with signs
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome