1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!


    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pathfinding not working (skQuery)

Discussion in 'Skript' started by Buster Bluth, Dec 12, 2021.

Thread Status:
Not open for further replies.
  1. Buster Bluth

    Buster Bluth Member

    Dec 12, 2021
    Likes Received:
    Hi friends. I'm having trouble getting pathfinding to work with skQuery. I want a selected mob to pathfind to a selected destination. My code is reloading successfully with no errors, but it just doesn't work. I'll put my code down below.

    on right click with stick:
    if name of targeted entity is set:
    message name of targeted entity to player
    set {%player%.selected_sim} to name of targeted entity

    on left click with stick:
    cancel event
    if {%player%.selected_sim} is set:
    set {%player%.target_block} to location at block above targeted block
    loop all entities:
    if name of loop-entity is "%{%player%.selected_sim}%":
    while loop-entity exists:
    make loop-entity pathfind to {%player%.target_block} with speed 1
    wait 1 tick

    The only part of this that works is the message. As I said, the code reloads fine; but the console gave me a "Severe error: something went horribly wrong with Skript" message when I tried to use it. I've tried this on both 1.17 and 1.18 since skQuery is technically only updated for 1.17--but I have the same problem regardless. Anybody know what the problem is?
    Thanks for any help!
Thread Status:
Not open for further replies.

Share This Page