Question Stop ThrowableProjectile from slowing down without gravity

Discussion in 'Bukkit Help' started by rability, Jul 25, 2023.

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

    rability

    Basically I plan to use retextured snowball as a bullet, that goes in a straight line. Disabled gravity, used player's direction vector, works fine, except it slows down overtime. I don't know why exactly this happens, docs don't really seem to have any quick fix to this, and I don't really think constantly reseting speed is the way. Any suggestions to keep speed consistent?

    Code:
    case "Projectile":
                        Snowball snowball = p.launchProjectile(Snowball.class, p.getLocation().getDirection());
                        snowball.setItem(new ItemStack(Material.STONE));
                        snowball.setGravity(false);
                        break;
     
Thread Status:
Not open for further replies.

Share This Page