#Pathfind only on certain block

1 messages · Page 1 of 1 (latest)

unreal parcel
#

My goal is to make a mob pathfind to a location but only by walking on a certain block for example "dirt"

#
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

terse marten
#

maybe while block below = dirt

unreal parcel
#

What do you mean?

terse marten
#

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

sharp bay
#

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.

unreal parcel