--- a/net/minecraft/world/entity/monster/CaveSpider.java
+++ b/net/minecraft/world/entity/monster/CaveSpider.java
@@ -20,6 +20,7 @@
 import org.joml.Vector3f;
 
 public class CaveSpider extends Spider {
+
     public CaveSpider(EntityType<? extends CaveSpider> type, Level world) {
         super(type, world);
     }
@@ -32,15 +33,16 @@
     public boolean doHurtTarget(Entity target) {
         if (super.doHurtTarget(target)) {
             if (target instanceof LivingEntity) {
-                int i = 0;
+                byte b0 = 0;
+
                 if (this.level().getDifficulty() == Difficulty.NORMAL) {
-                    i = 7;
+                    b0 = 7;
                 } else if (this.level().getDifficulty() == Difficulty.HARD) {
-                    i = 15;
+                    b0 = 15;
                 }
 
-                if (i > 0) {
-                    ((LivingEntity)target).addEffect(new MobEffectInstance(MobEffects.POISON, i * 20, 0), this);
+                if (b0 > 0) {
+                    ((LivingEntity) target).addEffect(new MobEffectInstance(MobEffects.POISON, b0 * 20, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
                 }
             }
 
