Heads face towards you when you place them. If you want to place a head face left, move to the left of the spot you're going to place it in before you place it. This is the same as almost anything else that has an orientation, so I assume you want to turn it around with commands.
To rotate a head with commands, the tag you need to edit is the "Rot" byte. For example, to make a head below you turn west, use this command:
/blockdata ~ ~-1 ~ {Rot:4b}
Here's a full list of what direction each number reperesents:
- 0: south
- 1: south-southwest
- 2: southwest
- 3: west-southwest
- 4: west
- 5: west-northwest
- 6: northwest
- 7: north-northwest
- 8: north
- 9: north-northeast
- 10: northeast
- 11: east-northeast
- 12: east
- 13: east-southeast
- 14: southeast
- 15: south-southeast
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
In
/setblock
, you should alter the sign's[dataValue]
(argument after<TileName>
) to change its rotation.For wall signs:
dataValue ║ Direction
══════╬══════
2 ║ north
3 ║ south
4 ║ west
5 ║ east
As you said the default direction (facing north) is the opposite of the direction you want it to face, to have it face south your command should look something like this:
Also, I added quotes around all of the strings. This makes the command comply with strict JSON parsing, and will keep it working after the 1.9 update (should also still work in 1.8).