I have been developing an adventure map in 1.12.2 for quite some time, and decided to upgrade to 1.13+. I created NPC-s who talk when the player approaches them. It works this way:
/execute @e[tag=talking_npc] ~ ~ ~ testfor @p[r=2]
<- in a repeat, always active command block.A redstone comparator
/execute @e[tag=talking_npc] ~ ~ ~ say "Something"
<- in a regual, redstone activated command block
This way when the first command block finds a player, it sends a redstone signal to the comparator, which in turn activates the second command block. This way the npc executes the SAY command only once.
My question is that now from 1.13 the testfor command has been removed, I've been trying to create this system with execute command and failed so far. When I approach the npc, the command executes repeatedly, which is obviously not correct. Is there any way to make it post 1.13?
Thanks for the answers in advance!