Minecraft – How to edit pathfinding command

minecraft-commandsminecraft-java-edition

I'm creating a map and the scientist in it is a villager and I want to make him walk on a certain path that I create that goes in a certain direction. Basically I want to modify the 1.8 path finding command creation by Dragnoz Dragnoz's Video on Entity Pathfinding to work in 1.11. Is there any way of doing this?

Best Answer

I rebuild something similar, here are the four commands I used:

/execute @e[r=10] ~ ~ ~ detect ~ ~-1 ~ minecraft:stone_stairs 1 /tp @e[r=0] ~-0.3 ~ ~ 90 0
/execute @e[r=10] ~ ~ ~ detect ~ ~-1 ~ minecraft:stone_stairs 2 /tp @e[r=0] ~ ~ ~0.3 0 0
/execute @e[r=10] ~ ~ ~ detect ~ ~-1 ~ minecraft:stone_stairs 0 /tp @e[r=0] ~0.3 ~ ~ -90 0
/execute @e[r=10] ~ ~ ~ detect ~ ~-1 ~ minecraft:stone_stairs 3 /tp @e[r=0] ~ ~ ~-0.3 180 0

Note: I just put the commands in command blocks chained together, nice and simple. also ~ ~-1 ~ right after detect should be ~ ~-2 ~ if you want the stairs just under the floor.

should work, just have to change r=10 to something like type=Villager and its set up for cobblestone stairs. If you need it for other stairs, just let me know I should be able to get them.