Proximity Detection NPCs in vanilla minecraft 1.8

Опубликовано: 16 Июль 2026
на канале: PumpkinPlays (PumpkinPlays)
1,242
16

Using a couple of commands with a fill clock, you can walk up and talk to NPCs in VANILLA minecraft!

first, the scoreboard:
/scoreboard objectives add Chat dummy
/scoreboard objectives add NPC dummy

Then, on the fill clock run these 3:

/execute @p[score_Chat=0] ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 13 /scoreboard players set @p[score_Chat=0] Chat 1

/execute @p[score_Chat_min=1] ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 14 /scoreboard players set @p[score_Chat_min=1] Chat 0

/execute @p[score_Chat_min=1] ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 14 /scoreboard players set @p[score_Chat_min=1] NPC 0

on the fill clock, run this:
testfor @a[score_Chat_min=1] with the output running into a command block saying:
/execute @e[type=ArmorStand] ~ ~ ~ /execute @p[r=2,score_Chat_min=1] ~ ~ ~ /tellraw @a {"text":"","extra":[{"text":"-","color":"dark_green"},{"text":" Talk","color":"blue","clickEvent":{"action":"run_command","value":"/scoreboard players set @p[score_Chat_min=1,score_Chat=1] NPC 1"}}]}
Do this for each NPC making sure you use their name and change the value at the end of the tell raw tag..

then use the chat variable to run the /tellraw conversation branches!