#Pathfind only on certain block
1 messages · Page 1 of 1 (latest)
command /test:
permission: op
trigger:
spawn a sheep at player
make last spawned sheep pathfind towards location(-62, 61, -36, world "Main")
Just something simple like this, but only allow the sheep to walk on a certain block to pathfind
maybe while block below = dirt
What do you mean?
that is a while loop, you can use it to run some code (ie pathfinding) while some condition is true, in theis case, while the block below the sheep is dirt
If you're not afraid of algorithms, you can fiddle a bit with A* algorithm (pathfinding algorithm) and modify it so that only paths with that specific block are chosen.
Darth made an implementation of it in Skript, you can find it here.
Basically, you have to change the lines 106 and 107.
Yeah but you cant really modify pathfinding if the block is not the one i like.