diff --git a/src/main/java/io/github/sefiraat/crystamaehistoria/magic/spells/spellobjects/MagicProjectile.java b/src/main/java/io/github/sefiraat/crystamaehistoria/magic/spells/spellobjects/MagicProjectile.java index c22d5de3..66c3b73c 100644 --- a/src/main/java/io/github/sefiraat/crystamaehistoria/magic/spells/spellobjects/MagicProjectile.java +++ b/src/main/java/io/github/sefiraat/crystamaehistoria/magic/spells/spellobjects/MagicProjectile.java @@ -48,9 +48,12 @@ public void setVelocity(Location targetLocation, double speed) { @ParametersAreNonnullByDefault public void setVelocity(Vector vector, double speed) { Projectile projectile = (Projectile) Bukkit.getEntity(projectileUUID); - // Fireball projectiles want to move wrongly :) - if (projectile instanceof Fireball) { - ((Fireball) projectile).setDirection(vector); + if (projectile != null) { + // Fireball projectiles want to move wrongly :) + if (projectile instanceof Fireball) { + ((Fireball) projectile).setDirection(vector); + } + projectile.setVelocity(vector.multiply(speed)); } }