This is using the "obfuscated" JSON option. It does not require a server or external program as LucidiousXIV said, it does however require access to commands, which I assume you already have if you're making an adventure map.
To /tellraw
it into chat:
/tellraw @a {"obfuscated":"true","text":"This text will not be seen"}
To make a sign with it:
/setblock ~ ~ ~ standing_sign 0 replace {Text1:"{\"text\":\"This text will not be seen\",obfuscated:\"true\"}"}
You can do this using the /tellraw
command. The syntax is:
/tellraw <player> <raw json message>
For example, to have a command that activates on click, try running this:
/tellraw @a {"text":"Click this!","clickEvent":{"action":"run_command","value":"/say Hello!"}}
That has a "clickEvent" of type "run_command" with a value of the command to be run. There's a lot of different things you can do with JSON: displaying scoreboard objectives, selectors, items, achievements, entities, different text formatting, etc.
Here's a more complex command with the Yes/No choice and output you wanted:
/tellraw @p ["",{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p {\"text\":\"Confirmed!\",\"color\":\"green\"}"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Confirm","color":"green"}]}}},{"text":"/","color":"dark_gray","bold":"false"},{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p {\"text\":\"Cancelled\",\"color\":\"red\"}"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Cancel","color":"red"}]}}}]
You may want to learn more about the raw JSON text format, or use a JSON generator.
Best Answer
This is simple to do, but I'm not sure what kind of text you want so I display three kinds:
So first we will set up the command blocks like so:
Now we will leave the first one blank for now.
In the second command block you must add this command:
In the X Y and Z put in the coordinates of the button.
Now going back to the first command block we will now go over the three ways to create the "text" you were talking about:
To use /say simply type in /say following what you want it to say e.g:
.
Tellraw is far more advanced:
I will not explain it all:
Change "Hi there" with the text you want and change "blue" to the colour you want. This looks prettier than /say .
/title works similarly to /tellraw but the text appears in the middle of the screen and is far larger:
The same thing that applies to /tellraw applies to /title :