Correct Bow velocity?

Discussion in 'Plugin Development' started by Dyrocraft, Mar 26, 2013.

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

    Dyrocraft

    Does anyone know the correct bow velocity of shooting the arrow?

    When someone shoots an arrow it shows the arrow going off to the side but it hits them too. Can anyone help me.
     
  2. Offline

    skipperguy12

    What are you trying to do? You could just check for shoot event, and print the velocity, but depending on what you're doing you won't need to know this.
     
  3. Offline

    Dyrocraft

    What is happening is when people shoot another player they are hitting them but the arrow shows it going off to the side. I don't know what to do to fix it here is my onEntityShootBow Code:

    Code:
    package com.gmail.example.example.events;
     
    import com.gmail.example.example.example;
    import org.bukkit.entity.Arrow;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.EntityShootBowEvent;
    import org.bukkit.util.Vector;
     
    public class EntityShootBow
      implements Listener
    {
      @EventHandler
      public void onEntityShootBow(EntityShootBowEvent e)
      {
        if ((e.getEntity() instanceof Player)) {
          Player p = (Player)e.getEntity();
     
          if (BowWarfare.getInstance().getArena(p) == -1) {
            return;
          }
     
          if ((e.getProjectile() instanceof Arrow)) {
            Arrow arrow = (Arrow)e.getProjectile();
            arrow.setVelocity(arrow.getVelocity().multiply(new Vector(10, 10, 10)));
          }
        }
      }
    }
     
  4. Offline

    PHILLIPS_71

    If you mean when you shoot someone it appears the arrow is going off to the side it is a glitch i don't think there is anyway of fixing it i could be wrong bit don't worry the arrow still hits them a does damage.
     
  5. Offline

    Dyrocraft

    PHILLIPS_71

    My Customer does not like when this happens.
    I know there is a way to fix it, the plugin generated it in the first place.
     
  6. Offline

    microgeek

    No, I honestly don't think you can without looping the arrow every tick and setting a generated position and velocity. Try lowering the speed?
     
Thread Status:
Not open for further replies.

Share This Page