How do I make a villager do different things when clicked on multiple times?
-
I understand
load.mcfunction
in data packs is for anything in-game when reloaded. Andtick.mcfunction
is for anything occuring according to in-game ticks. With this limited knowledge I got villagers to/tellraw
back at me when in a certain range. I also got a villager to/tellraw
back at me when clicked (using objectives timer dummy andtalked_to_villager
).I wanted to make the same villager respond to me differently on each click. I know one can check the minimum score and proceed that way, which I tried to by the way, and now everything broke.
I reverted back to the old state of villagers responding when in range. Would someone be kind enough to help me with villager talking on click and multiple response (3)?
-
I think you were on the right track with the scoreboard idea. You could probably always reset whatever scoreboard tracks for interactions with villagers, then execute at a player who's score is 1. At this player, you would then run a command to generate a random response based on game tick or game time. Or you could use predicates of chance (20% etc)