1.14.4 Fireballs veer off to the south??

Discussion in 'Spigot Plugin Development' started by KingUmbreon56, Mar 26, 2020.

  1. So I'm trying to spawn a fireball and have it explode at my feet, but I noticed when I spawn it it veers off to the south. Here's my code:
    Code (Java):
            Player player = (Player) sender;
            Location loc = player.getLocation();
            int x = loc.getBlockX();
            int y = loc.getBlockY();
            int z = loc.getBlockZ();
         
            Entity ent = player.getWorld().spawnEntity(loc, EntityType.FIREBALL);
            Fireball fireball = (Fireball) ent;
            fireball.setYield(20);
         
            fireball.setVelocity(loc.getDirection().normalize().multiply(2));
    Can anyone help?

    EDIT: This guy had the same problem and figured it out but thats not working for me:
    https://www.spigotmc.org/threads/sh...y-projectile-curve-south.169865/#post-1799907
     
  2. According to the Fireball page, "Fireballs fly straight and do not take setVelocity(...) well."

    Use .setDirection instead.