Solved Shooting projectiles doesn't work

Discussion in 'Plugin Development' started by CrossPL, Sep 6, 2013.

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

    CrossPL

    Hello,

    I'm trying to spawn and shoot projectile (snowball) but I can't make it work.
    It falls down immediately.
    Here's my code:
    Code:java
    1. Snowball snowball = player.getWorld().spawn(player.getEyeLocation(), Snowball.class);
    2. snowball.setShooter(player);
    3. snowball.setFallDistance(FallDistance); // FallDistance = 15 (float) (also tried with 250 and no setFallDistance)
    4. snowball.setVelocity(player.getEyeLocation().getDirection().multiply(Velocity)); // Velocity = 2.25 (double)
     
  2. Offline

    Musaddict

    CrossPL likes this.
  3. Offline

    blablubbabc

    I guess that you are testing with spigot: I know that some spigot builds have this problem..
     
    CrossPL likes this.
  4. Offline

    CrossPL


    You're right. The hoster was using Spigot and I didn't even know about it...
    It works now, thank you very much for your help :)
     
Thread Status:
Not open for further replies.

Share This Page