How to make an entity jump in direction of another?

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

pepper82

Member
Jan 26, 2017
272
1
18
41
Hi all,

I have spawned a zombie which I want to make jump towards the player. Is this possible? And if so, how would you do it?
 
code_language.skript:
set {_vector} to vector between last spawned zombie and player's location
push last spawned zombie {_vector} at speed 1
the push effect doesn't accept vectors, you'd use the velocity expression of RandomSK (the Skript one is broken at the moment, waiting for the pull request of Sashie to be merged in the next release to fix this).

If you have skQuery you can achieve the same anyways:
code_language.skript:
push last spawned zombie (direction from player to last spawned zombie) at speed 1
 
the push effect doesn't accept vectors, you'd use the velocity expression of RandomSK (the Skript one is broken at the moment, waiting for the pull request of Sashie to be merged in the next release to fix this).

If you have skQuery you can achieve the same anyways:
code_language.skript:
push last spawned zombie (direction from player to last spawned zombie) at speed 1
it accepts vectors for me (dev29 & spigot 1.12)
i tested with this:
code_language.skript:
on leftclick holding stick:
    spawn a zombie above target block
    set {_vector} to vector between last spawned zombie and player's location
    push last spawned zombie {_vector} at speed 1
but i guess the skquery way you showed is better since its only 1 line :emoji_smile:
 
Status
Not open for further replies.