--- a/net/minecraft/world/entity/projectile/LlamaSpit.java
+++ b/net/minecraft/world/entity/projectile/LlamaSpit.java
@@ -17,8 +17,12 @@
 import net.minecraft.world.phys.EntityHitResult;
 import net.minecraft.world.phys.HitResult;
 import net.minecraft.world.phys.Vec3;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityRemoveEvent;
+// CraftBukkit end
 
 public class LlamaSpit extends Projectile {
+
     public LlamaSpit(EntityType<? extends LlamaSpit> type, Level world) {
         super(type, world);
     }
@@ -26,76 +30,86 @@
     public LlamaSpit(Level world, Llama owner) {
         this(EntityType.LLAMA_SPIT, world);
         this.setOwner(owner);
-        this.setPos(
-            owner.getX() - (double)(owner.getBbWidth() + 1.0F) * 0.5 * (double)Mth.sin(owner.yBodyRot * (float) (Math.PI / 180.0)),
-            owner.getEyeY() - 0.1F,
-            owner.getZ() + (double)(owner.getBbWidth() + 1.0F) * 0.5 * (double)Mth.cos(owner.yBodyRot * (float) (Math.PI / 180.0))
-        );
+        this.setPos(owner.getX() - (double) (owner.getBbWidth() + 1.0F) * 0.5D * (double) Mth.sin(owner.yBodyRot * 0.017453292F), owner.getEyeY() - 0.10000000149011612D, owner.getZ() + (double) (owner.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(owner.yBodyRot * 0.017453292F));
     }
 
     @Override
     protected double getDefaultGravity() {
-        return 0.06;
+        return 0.06D;
     }
 
     @Override
     public void tick() {
         super.tick();
-        Vec3 vec3 = this.getDeltaMovement();
-        HitResult hitResult = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
-        this.hitTargetOrDeflectSelf(hitResult);
-        double d = this.getX() + vec3.x;
-        double e = this.getY() + vec3.y;
-        double f = this.getZ() + vec3.z;
+        Vec3 vec3d = this.getDeltaMovement();
+        HitResult movingobjectposition = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
+
+        this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
+        double d0 = this.getX() + vec3d.x;
+        double d1 = this.getY() + vec3d.y;
+        double d2 = this.getZ() + vec3d.z;
+
         this.updateRotation();
-        float g = 0.99F;
+        float f = 0.99F;
+
         if (this.level().getBlockStates(this.getBoundingBox()).noneMatch(BlockBehaviour.BlockStateBase::isAir)) {
-            this.discard();
+            this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
         } else if (this.isInWaterOrBubble()) {
-            this.discard();
+            this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
         } else {
-            this.setDeltaMovement(vec3.scale(0.99F));
+            this.setDeltaMovement(vec3d.scale(0.9900000095367432D));
             this.applyGravity();
-            this.setPos(d, e, f);
+            this.setPos(d0, d1, d2);
         }
     }
 
     @Override
     protected void onHitEntity(EntityHitResult entityHitResult) {
         super.onHitEntity(entityHitResult);
-        if (this.getOwner() instanceof LivingEntity livingEntity) {
-            Entity entity = entityHitResult.getEntity();
-            DamageSource damageSource = this.damageSources().spit(this, livingEntity);
-            if (entity.hurt(damageSource, 1.0F) && this.level() instanceof ServerLevel serverLevel) {
-                EnchantmentHelper.doPostAttackEffects(serverLevel, entity, damageSource);
+        Entity entity = this.getOwner();
+
+        if (entity instanceof LivingEntity entityliving) {
+            entity = entityHitResult.getEntity();
+            DamageSource damagesource = this.damageSources().spit(this, entityliving);
+
+            if (entity.hurt(damagesource, 1.0F)) {
+                Level world = this.level();
+
+                if (world instanceof ServerLevel) {
+                    ServerLevel worldserver = (ServerLevel) world;
+
+                    EnchantmentHelper.doPostAttackEffects(worldserver, entity, damagesource);
+                }
             }
         }
+
     }
 
     @Override
     protected void onHitBlock(BlockHitResult blockHitResult) {
         super.onHitBlock(blockHitResult);
         if (!this.level().isClientSide) {
-            this.discard();
+            this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
         }
+
     }
 
     @Override
-    protected void defineSynchedData(SynchedEntityData.Builder builder) {
-    }
+    protected void defineSynchedData(SynchedEntityData.Builder builder) {}
 
     @Override
     public void recreateFromPacket(ClientboundAddEntityPacket packet) {
         super.recreateFromPacket(packet);
-        double d = packet.getXa();
-        double e = packet.getYa();
-        double f = packet.getZa();
+        double d0 = packet.getXa();
+        double d1 = packet.getYa();
+        double d2 = packet.getZa();
 
-        for (int i = 0; i < 7; i++) {
-            double g = 0.4 + 0.1 * (double)i;
-            this.level().addParticle(ParticleTypes.SPIT, this.getX(), this.getY(), this.getZ(), d * g, e, f * g);
+        for (int i = 0; i < 7; ++i) {
+            double d3 = 0.4D + 0.1D * (double) i;
+
+            this.level().addParticle(ParticleTypes.SPIT, this.getX(), this.getY(), this.getZ(), d0 * d3, d1, d2 * d3);
         }
 
-        this.setDeltaMovement(d, e, f);
+        this.setDeltaMovement(d0, d1, d2);
     }
 }
