I'm trying to get a villager to constantly stare at a player when within the range of 5 blocks, need some help on the staring part.
Thanks in advance again
Also thanks for all the help so far @Megacrafter107
No problem here is the command you need:
/execute as @a at @s run execute as @e[type=villager,distance=..5] at @s run tp @s ~ ~ ~ facing entity @p feet
I should mention that this will cause the villagers to spin in place from time to time. A way to get around this would be to disable their AI when within range.
/execute as @a at @s run execute as @e[type=minecraft:villager,distance=..5] run data merge entity @s {NoAI:1}
execute as @a at @s run execute as @e[type=minecraft:villager,distance=5..10] run data merge entity @s {NoAI:0}
the last two commands are optional.
just run all three commands in a loop and it should work
I'm trying to get a villager to constantly stare at a player when within the range of 5 blocks, need some help on the staring part.
Thanks in advance again
Also thanks for all the help so far @Megacrafter107
No problem here is the command you need:
I should mention that this will cause the villagers to spin in place from time to time. A way to get around this would be to disable their AI when within range.
the last two commands are optional.
just run all three commands in a loop and it should work
Command block engineer // Developer // #TeamTrees