Branching dialogue in minecraft using a player scoreboard, a trigger, tellraw, and a command block chain?
I am trying to set up a branching dialogue system using command blocks, a scoreboard, a trigger objective, and a command block chain.
The first five command blocks work correctly. I can see the fourth and fifth command blocks updating my score. However, the sixth, seventh, and eighth command blocks don't work. I'm not sure why. I'm using the same commands that I used for the fifth command block. For some reason, they are not activating.
First Command Block (set as impulse, unconditional, needs redstone, and triggered by a pressure plate).
/scoreboard objectives add dialoguetrigger trigger
Second Command Block (set as chain, unconditional, always active).
/scoreboard players enable @p dialoguetrigger
Third Command Block (set as chain, unconditional, always active).
scoreboard objectives setdisplay sidebar dialoguetrigger
Fourth Command Block (set as chain, unconditional, always active).
scoreboard players set @p dialoguetrigger -1
Fifth Command Block (set as chain, unconditional, always active).
execute if score @p dialoguetrigger matches -1 run tellraw @p ["",{"text":"Bartholomew: Do you wish for me to speak with you? Enter the chat and click "},{"text":"SPEAK. ","color":"gold","clickEvent":{"action":"run_command","value":"/trigger dialoguetrigger set 3"}},{"text":"You may also ask for "},{"text":"SILENCE.","color":"gold","clickEvent":{"action":"run_command","value":" /trigger dialoguetrigger set 2"}}]
Sixth Command Block (set as chain, unconditional, always active).
execute if score @p dialoguetrigger matches 2 run tellraw @p ["",{"text":"Bartholomew: I’ll leave you to your thoughts."}]
Seventh Command Block (set as chain, unconditional, always active).
execute if score @p dialoguetrigger matches 1 run tellraw @p ["",{"text":"Bartholomew: The rooms have become unruly in your absence. Doors behind doors. "},{"text":"[...]","color":"gold","clickEvent":{"action":"run_command","value":"/trigger dialoguetrigger set 3"}}]
Eighth Command Block (set as chain, unconditional, always active).
execute if score @p dialoguetrigger matches 3 run tellraw @p ["",{"text":"HOW DARE YOU LET THIS HAPPEN!!! ","color":"gold","clickEvent":{"action":"run_command","value":"/trigger dialoguetrigger set 4"}},{"text":" OR "},{"text":"WHERE ARE THE GARDENS?","color":"gold","clickEvent":{"action":"run_command","value":"/trigger dialoguetrigger set 5"}}]
Pictures about "Branching dialogue in minecraft using a player scoreboard, a trigger, tellraw, and a command block chain?"



What is the Tellraw command in Minecraft?
You can use the /tellraw command to send a private JSON message to a player or group of players in Minecraft. This function allows you to format color, bold and italics for the message.Player usernames and scoreboard values in /tellraw command | Minecraft Bedrock
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Anete Lusina, Keira Burton, Fardad Postwala, Tatiana Syrikova
