332: Villager dialogue using clickable tellraw. [Minecraft Map Making]
Ep332: Title says it, description too long already.
00:00 Introduction
03:00 Setup
13:40 Proximity
19:30 Bob Dialogue
37:20 Bob Triggers
47:00 Tom stuff
Version: 1.20.6
Old version: https://youtu.be/omPCJzYfdU4
Requested by: WhosTigerCub
Some commands used:
Summon Villager:
IUN: summon villager ~ ~ ~3 {Tags:["NPC", "Bob"], Invulnerable:true, CustomName:'{"text":"Bob"}', VillagerData:{profession:"librarian", type:"plains", level:99}}
CUA: scoreboard players set @e[tag=Bob] villager_id 1
Controller Proxmity:
RUA: scoreboard players set @a[scores={villager_id=1..}] villager_id 0
CUA: execute as @a at @s if entity @e[type=villager, tag=NPC, distance=0..3, limit=1] run scoreboard players operation @s villager_id = @e[type=villager, tag=NPC, distance=0..3, limit=1] villager_id
CUA: execute as @a[scores={has_talked=1..}] at @s unless entity @e[type=villager, tag=NPC, distance=..3, limit=1] run scoreboard players reset @s has_talked
Controller Chat:
RUA: execute as @a[scores={villager_id=1, has_talked=1..}] run setblock ~2 ~ ~ redstone_block
Dialogue Bob:
IUN: execute as @a[scores={has_talked=1.., villager_id=1}] unless score @s chat_progress_1 matches 1.. run tellraw @s [{"text":"Bob ", "color":"aqua"}, {"text":"Hello. :)", "color":"green"}]
CUA: execute as @a[scores={has_talked=1.., villager_id=1, chat_progress_1=1}] run tellraw @s [{"text":"Bob ", "color":"aqua"}, {"text":"What would you like to know about?", "color":"green"}]
CUA: execute as @a[scores={has_talked=1.., villager_id=1, chat_progress_1=1}] run tellraw @s [{"text":"Option: ", "color":"gray"}, {"text":"Tell me about Tom.", "color":"gold", "clickEvent":{"action":"run_command","value":"/trigger trigger_bob set 1"}}]
CUA: execute as @a[scores={has_talked=1.., villager_id=1, chat_progress_1=1}] run tellraw @s [{"text":"Option: ", "color":"gray"}, {"text":"Where is Tom?", "color":"gold", "clickEvent":{"action":"run_command","value":"/trigger trigger_bob set 2"}}]
CUA: scoreboard players set @a[scores={has_talked=1.., villager_id=1, chat_progress_1=1}] chat_progress_1 -1
CUA: execute as @a[scores={has_talked=1.., villager_id=1, chat_progress_1=2}] run tellraw @s [{"text":"Bob ", "color":"aqua"}, {"text":"Will Tom give back my emerald?", "color":"green"}]
CUA: execute as @a[scores={has_talked=1.., villager_id=1, chat_progress_1=2}] run tellraw @s [{"text":"Option: ", "color":"gray"}, {"text":"I didn't ask.", "color":"gold", "clickEvent":{"action":"run_command","value":"/trigger trigger_bob set 3"}}]
CUA: execute as @a[scores={has_talked=1.., villager_id=1, chat_progress_1=2}] run tellraw @s [{"text":"Option: ", "color":"gray"}, {"text":"He said no.", "color":"gold", "clickEvent":{"action":"run_command","value":"/trigger trigger_bob set 4"}}]
CUA: scoreboard players set @a[scores={has_talked=1.., villager_id=1, chat_progress_1=2}] chat_progress_1 0
CUA: scoreboard players add @a[scores={has_talked=1.., villager_id=1}] chat_progress_1 1
CUA: scoreboard players reset @a has_talked
Controller Bob Trigger
RUA: execute as @a[scores={trigger_bob=1}] run setblock ~2 ~ ~ redstone_block
Options Bob 1:
IUN: tellraw @a[scores={trigger_bob=1}] [{"text":"Bob ", "color":"aqua"}, {"text":"Tom has my Emerald. Go and get it!", "color":"green"}]
CUA: scoreboard players reset @a trigger_bob
CUA: scoreboard players enable @a trigger_bob
Dialogue Tom:
IUN: execute as @a[scores={has_talked=1.., villager_id=2}] unless score @s chat_progress_2 matches 1.. run tellraw @s [{"text":"Tom ", "color":"aqua"}, {"text":"Hey.", "color":"green"}]
CUA: execute as @a[scores={has_talked=1.., villager_id=2, chat_progress_2=1}] run tellraw @s [{"text":"Tom ", "color":"aqua"}, {"text":"How can I help you?", "color":"green"}]
CUA: execute as @a[scores={has_talked=1.., villager_id=2, chat_progress_2=1}] run tellraw @s [{"text":"Option: ", "color":"gray"}, {"text":"Do you have Bob's emerald?", "color":"gold", "clickEvent":{"action":"run_command","value":"/trigger trigger_tom set 1"}}]
CUA: execute as @a[scores={has_talked=1.., villager_id=2, chat_progress_2=1}] run tellraw @s [{"text":"Option: ", "color":"gray"}, {"text":"Can I have it?", "color":"gold", "clickEvent":{"action":"run_command","value":"/trigger trigger_tom set 2"}}]
CUA: scoreboard players set @a[scores={has_talked=1.., villager_id=2, chat_progress_2=1}] chat_progress_2 -1
CUA: scoreboard players add @a[scores={has_talked=1.., villager_id=2}] chat_progress_2 1
CUA: scoreboard players reset @a has_talked
Controller Bob Trigger
RUA: execute as @a[scores={trigger_tom=1}] run setblock ~2 ~ ~ redstone_block
CUA: execute as @a[scores={trigger_tom=2}] run setblock ~2 ~ ~ redstone_block
Options Tom 1:
IUN: tellraw @a[scores={trigger_tom=1}] [{"text":"Tom ", "color":"aqua"}, {"text":"I do. It's mine now.", "color":"green"}]
CUA: scoreboard players set @a[scores={trigger_tom=1}] chat_progress_1 2
CUA: scoreboard players reset @a trigger_tom
CUA: scoreboard players enable @a trigger_tom
Other Videos By Infernal Device
Other Statistics
Minecraft Statistics For Infernal Device
At present, Infernal Device has 181,722 views spread across 860 videos for Minecraft, accounting for over 10 days of watchable video on his channel. This is 94.82% of the total watchable video for Minecraft on Infernal Device's YouTube channel.