Mapmakers use invisible villagers in front of blocks to register a right click on that block by using the "minecraft.custom:minecraft.talked_to_villager" criteria. While this is effective, it's not exactly accurate as there can be more villagers in one area and it is hard to determine which villager the player clicked. This new criteria would allow us to detect which villager the player clicked by testing the villagers score and his tag.
Example:
if there are two villagers in the same area, one has a tag of "a" and the other one a tag of "b", we could use the following command to determine which one is clicked:
/execute if entity @e[type=villager,tag=a,scores={clicked=1..}]
/execute if entity @e[type=villager,tag=b,scores={clicked=1..}]
Please sign in to leave a comment.
1 Comments