Making an arrow fly straight, without falling

Discussion in 'Plugin Development' started by nzkiwi.5000, Jul 15, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    nzkiwi.5000

    Hello,
    I recently came up with a concept for a plugin, and i need to solve one problem - how to make an arrow entity fly straight line?
     
  2. Offline

    TheMrGong

    I would assume your get the direction of the arrow and teleport it to where its facing
     
  3. Offline

    mythbusterma

    nzkiwi.5000

    You could possibly override the Arrow entity and make an arrow that ignores gravity (or just teleport it I guess, but then it would be instantaneous).
     
    nzkiwi.5000 likes this.
  4. Offline

    Aventium

    Set the arrow's velocity?
     
  5. Offline

    Necrodoom

    Would end up looking like its instantaneous.
     
  6. Offline

    nzkiwi.5000

    mythbusterma Org.bukkit.entity.Arrow or NMS EntityArrow class? And how then I make it ignore gravity?
     
  7. Offline

    mythbusterma

    It would be NMS EntityArrow, and dig through the class to find out where gravity is applied. It looks like it's applied somewhere in the method "h()" on line 118 of EntityArrow.java.
     
  8. Offline

    nzkiwi.5000

    thanks, i'll take a look. would you help me wih removing gravity?
     
  9. Offline

    mythbusterma

    Sure, add me on skype (same name as here) and I'll post the completed class here.
     
Thread Status:
Not open for further replies.

Share This Page