--- a/net/minecraft/world/entity/raid/Raider.java
+++ b/net/minecraft/world/entity/raid/Raider.java
@@ -2,6 +2,7 @@
 
 import com.google.common.collect.Lists;
 import java.util.EnumSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
@@ -36,12 +37,16 @@
 import net.minecraft.world.level.Level;
 import net.minecraft.world.level.ServerLevelAccessor;
 import net.minecraft.world.phys.Vec3;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityRemoveEvent;
+// CraftBukkit end
 
 public abstract class Raider extends PatrollingMonster {
+
     protected static final EntityDataAccessor<Boolean> IS_CELEBRATING = SynchedEntityData.defineId(Raider.class, EntityDataSerializers.BOOLEAN);
-    static final Predicate<ItemEntity> ALLOWED_ITEMS = itemEntity -> !itemEntity.hasPickUpDelay()
-            && itemEntity.isAlive()
-            && ItemStack.matches(itemEntity.getItem(), Raid.getLeaderBannerInstance(itemEntity.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)));
+    static final Predicate<ItemEntity> ALLOWED_ITEMS = (entityitem) -> {
+        return !entityitem.hasPickUpDelay() && entityitem.isAlive() && ItemStack.matches(entityitem.getItem(), Raid.getLeaderBannerInstance(entityitem.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)));
+    };
     @Nullable
     protected Raid raid;
     private int wave;
@@ -55,16 +60,16 @@
     @Override
     protected void registerGoals() {
         super.registerGoals();
-        this.goalSelector.addGoal(1, new Raider.ObtainRaidLeaderBannerGoal<>(this));
+        this.goalSelector.addGoal(1, new Raider.ObtainRaidLeaderBannerGoal<>(this, this));
         this.goalSelector.addGoal(3, new PathfindToRaidGoal<>(this));
-        this.goalSelector.addGoal(4, new Raider.RaiderMoveThroughVillageGoal(this, 1.05F, 1));
+        this.goalSelector.addGoal(4, new Raider.RaiderMoveThroughVillageGoal(this, 1.0499999523162842D, 1));
         this.goalSelector.addGoal(5, new Raider.RaiderCelebration(this));
     }
 
     @Override
     protected void defineSynchedData(SynchedEntityData.Builder builder) {
         super.defineSynchedData(builder);
-        builder.define(IS_CELEBRATING, false);
+        builder.define(Raider.IS_CELEBRATING, false);
     }
 
     public abstract void applyRaidBuffs(ServerLevel world, int wave, boolean unused);
@@ -81,17 +86,20 @@
     public void aiStep() {
         if (this.level() instanceof ServerLevel && this.isAlive()) {
             Raid raid = this.getCurrentRaid();
+
             if (this.canJoinRaid()) {
                 if (raid == null) {
                     if (this.level().getGameTime() % 20L == 0L) {
-                        Raid raid2 = ((ServerLevel)this.level()).getRaidAt(this.blockPosition());
-                        if (raid2 != null && Raids.canJoinRaid(this, raid2)) {
-                            raid2.joinRaid(raid2.getGroupsSpawned(), this, null, true);
+                        Raid raid1 = ((ServerLevel) this.level()).getRaidAt(this.blockPosition());
+
+                        if (raid1 != null && Raids.canJoinRaid(this, raid1)) {
+                            raid1.joinRaid(raid1.getGroupsSpawned(), this, (BlockPos) null, true);
                         }
                     }
                 } else {
-                    LivingEntity livingEntity = this.getTarget();
-                    if (livingEntity != null && (livingEntity.getType() == EntityType.PLAYER || livingEntity.getType() == EntityType.IRON_GOLEM)) {
+                    LivingEntity entityliving = this.getTarget();
+
+                    if (entityliving != null && (entityliving.getType() == EntityType.PLAYER || entityliving.getType() == EntityType.IRON_GOLEM)) {
                         this.noActionTime = 0;
                     }
                 }
@@ -111,6 +119,7 @@
         if (this.level() instanceof ServerLevel) {
             Entity entity = damageSource.getEntity();
             Raid raid = this.getCurrentRaid();
+
             if (raid != null) {
                 if (this.isPatrolLeader()) {
                     raid.removeLeader(this.getWave());
@@ -142,15 +151,21 @@
     }
 
     public boolean isCaptain() {
-        ItemStack itemStack = this.getItemBySlot(EquipmentSlot.HEAD);
-        boolean bl = !itemStack.isEmpty()
-            && ItemStack.matches(itemStack, Raid.getLeaderBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)));
-        boolean bl2 = this.isPatrolLeader();
-        return bl && bl2;
+        ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
+        boolean flag = !itemstack.isEmpty() && ItemStack.matches(itemstack, Raid.getLeaderBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)));
+        boolean flag1 = this.isPatrolLeader();
+
+        return flag && flag1;
     }
 
     public boolean hasRaid() {
-        return this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null);
+        Level world = this.level();
+
+        if (!(world instanceof ServerLevel worldserver)) {
+            return false;
+        } else {
+            return this.getCurrentRaid() != null || worldserver.getRaidAt(this.blockPosition()) != null;
+        }
     }
 
     public boolean hasActiveRaid() {
@@ -166,11 +181,11 @@
     }
 
     public boolean isCelebrating() {
-        return this.entityData.get(IS_CELEBRATING);
+        return (Boolean) this.entityData.get(Raider.IS_CELEBRATING);
     }
 
     public void setCelebrating(boolean celebrating) {
-        this.entityData.set(IS_CELEBRATING, celebrating);
+        this.entityData.set(Raider.IS_CELEBRATING, celebrating);
     }
 
     @Override
@@ -181,6 +196,7 @@
         if (this.raid != null) {
             nbt.putInt("RaidId", this.raid.getId());
         }
+
     }
 
     @Override
@@ -190,7 +206,7 @@
         this.canJoinRaid = nbt.getBoolean("CanJoinRaid");
         if (nbt.contains("RaidId", 3)) {
             if (this.level() instanceof ServerLevel) {
-                this.raid = ((ServerLevel)this.level()).getRaids().get(nbt.getInt("RaidId"));
+                this.raid = ((ServerLevel) this.level()).getRaids().get(nbt.getInt("RaidId"));
             }
 
             if (this.raid != null) {
@@ -200,36 +216,45 @@
                 }
             }
         }
+
     }
 
     @Override
     protected void pickUpItem(ItemEntity item) {
-        ItemStack itemStack = item.getItem();
-        boolean bl = this.hasActiveRaid() && this.getCurrentRaid().getLeader(this.getWave()) != null;
-        if (this.hasActiveRaid()
-            && !bl
-            && ItemStack.matches(itemStack, Raid.getLeaderBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) {
-            EquipmentSlot equipmentSlot = EquipmentSlot.HEAD;
-            ItemStack itemStack2 = this.getItemBySlot(equipmentSlot);
-            double d = (double)this.getEquipmentDropChance(equipmentSlot);
-            if (!itemStack2.isEmpty() && (double)Math.max(this.random.nextFloat() - 0.1F, 0.0F) < d) {
-                this.spawnAtLocation(itemStack2);
+        ItemStack itemstack = item.getItem();
+        boolean flag = this.hasActiveRaid() && this.getCurrentRaid().getLeader(this.getWave()) != null;
+
+        if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getLeaderBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) {
+            // Paper start - EntityPickupItemEvent fixes
+            if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) {
+                return;
+            }
+            // Paper end - EntityPickupItemEvent fixes
+            EquipmentSlot enumitemslot = EquipmentSlot.HEAD;
+            ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
+            double d0 = (double) this.getEquipmentDropChance(enumitemslot);
+
+            if (!itemstack1.isEmpty() && (double) Math.max(this.random.nextFloat() - 0.1F, 0.0F) < d0) {
+                this.forceDrops = true; // Paper - Add missing forceDrop toggles
+                this.spawnAtLocation(itemstack1);
+                this.forceDrops = false; // Paper - Add missing forceDrop toggles
             }
 
             this.onItemPickup(item);
-            this.setItemSlot(equipmentSlot, itemStack);
-            this.take(item, itemStack.getCount());
-            item.discard();
+            this.setItemSlot(enumitemslot, itemstack);
+            this.take(item, itemstack.getCount());
+            item.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause
             this.getCurrentRaid().setLeader(this.getWave(), this);
             this.setPatrolLeader(true);
         } else {
             super.pickUpItem(item);
         }
+
     }
 
     @Override
     public boolean removeWhenFarAway(double distanceSquared) {
-        return this.getCurrentRaid() == null && super.removeWhenFarAway(distanceSquared);
+        return this.getCurrentRaid() == null ? super.removeWhenFarAway(distanceSquared) : false;
     }
 
     @Override
@@ -263,136 +288,169 @@
 
     public abstract SoundEvent getCelebrateSound();
 
-    public class HoldGroundAttackGoal extends Goal {
-        private final Raider mob;
-        private final float hostileRadiusSqr;
-        public final TargetingConditions shoutTargeting = TargetingConditions.forNonCombat().range(8.0).ignoreLineOfSight().ignoreInvisibilityTesting();
+    public class ObtainRaidLeaderBannerGoal<T extends Raider> extends Goal {
 
-        public HoldGroundAttackGoal(final AbstractIllager illager, final float distance) {
-            this.mob = illager;
-            this.hostileRadiusSqr = distance * distance;
-            this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK));
+        private final T mob;
+
+        public ObtainRaidLeaderBannerGoal(final Raider actor, final T entityraider1) { // CraftBukkit - decompile error
+            this.mob = entityraider1;
+            this.setFlags(EnumSet.of(Goal.Flag.MOVE));
         }
 
         @Override
         public boolean canUse() {
-            LivingEntity livingEntity = this.mob.getLastHurtByMob();
-            return this.mob.getCurrentRaid() == null
-                && this.mob.isPatrolling()
-                && this.mob.getTarget() != null
-                && !this.mob.isAggressive()
-                && (livingEntity == null || livingEntity.getType() != EntityType.PLAYER);
-        }
+            if (!this.mob.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
+            Raid raid = this.mob.getCurrentRaid();
 
-        @Override
-        public void start() {
-            super.start();
-            this.mob.getNavigation().stop();
+            if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance(this.mob.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) {
+                Raider entityraider = raid.getLeader(this.mob.getWave());
 
-            for (Raider raider : this.mob
-                .level()
-                .getNearbyEntities(Raider.class, this.shoutTargeting, this.mob, this.mob.getBoundingBox().inflate(8.0, 8.0, 8.0))) {
-                raider.setTarget(this.mob.getTarget());
-            }
-        }
+                if (entityraider == null || !entityraider.isAlive()) {
+                    List<ItemEntity> list = this.mob.level().getEntitiesOfClass(ItemEntity.class, this.mob.getBoundingBox().inflate(16.0D, 8.0D, 16.0D), Raider.ALLOWED_ITEMS);
 
-        @Override
-        public void stop() {
-            super.stop();
-            LivingEntity livingEntity = this.mob.getTarget();
-            if (livingEntity != null) {
-                for (Raider raider : this.mob
-                    .level()
-                    .getNearbyEntities(Raider.class, this.shoutTargeting, this.mob, this.mob.getBoundingBox().inflate(8.0, 8.0, 8.0))) {
-                    raider.setTarget(livingEntity);
-                    raider.setAggressive(true);
+                    if (!list.isEmpty()) {
+                        return this.mob.getNavigation().moveTo((Entity) list.get(0), 1.149999976158142D);
+                    }
                 }
 
-                this.mob.setAggressive(true);
+                return false;
+            } else {
+                return false;
             }
         }
 
         @Override
-        public boolean requiresUpdateEveryTick() {
-            return true;
-        }
-
-        @Override
         public void tick() {
-            LivingEntity livingEntity = this.mob.getTarget();
-            if (livingEntity != null) {
-                if (this.mob.distanceToSqr(livingEntity) > (double)this.hostileRadiusSqr) {
-                    this.mob.getLookControl().setLookAt(livingEntity, 30.0F, 30.0F);
-                    if (this.mob.random.nextInt(50) == 0) {
-                        this.mob.playAmbientSound();
-                    }
-                } else {
-                    this.mob.setAggressive(true);
-                }
+            if (this.mob.getNavigation().getTargetPos().closerToCenterThan(this.mob.position(), 1.414D)) {
+                List<ItemEntity> list = this.mob.level().getEntitiesOfClass(ItemEntity.class, this.mob.getBoundingBox().inflate(4.0D, 4.0D, 4.0D), Raider.ALLOWED_ITEMS);
 
-                super.tick();
+                if (!list.isEmpty()) {
+                    this.mob.pickUpItem((ItemEntity) list.get(0));
+                }
             }
+
         }
     }
 
-    public class ObtainRaidLeaderBannerGoal<T extends Raider> extends Goal {
-        private final T mob;
+    private static class RaiderMoveThroughVillageGoal extends Goal {
 
-        public ObtainRaidLeaderBannerGoal(final T actor) {
-            this.mob = actor;
+        private final Raider raider;
+        private final double speedModifier;
+        private BlockPos poiPos;
+        private final List<BlockPos> visited = Lists.newArrayList();
+        private final int distanceToPoi;
+        private boolean stuck;
+
+        public RaiderMoveThroughVillageGoal(Raider raider, double speed, int distance) {
+            this.raider = raider;
+            this.speedModifier = speed;
+            this.distanceToPoi = distance;
             this.setFlags(EnumSet.of(Goal.Flag.MOVE));
         }
 
         @Override
         public boolean canUse() {
-            Raid raid = this.mob.getCurrentRaid();
-            if (this.mob.hasActiveRaid()
-                && !this.mob.getCurrentRaid().isOver()
-                && this.mob.canBeLeader()
-                && !ItemStack.matches(
-                    this.mob.getItemBySlot(EquipmentSlot.HEAD),
-                    Raid.getLeaderBannerInstance(this.mob.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN))
-                )) {
-                Raider raider = raid.getLeader(this.mob.getWave());
-                if (raider == null || !raider.isAlive()) {
-                    List<ItemEntity> list = this.mob
-                        .level()
-                        .getEntitiesOfClass(ItemEntity.class, this.mob.getBoundingBox().inflate(16.0, 8.0, 16.0), Raider.ALLOWED_ITEMS);
-                    if (!list.isEmpty()) {
-                        return this.mob.getNavigation().moveTo(list.get(0), 1.15F);
-                    }
-                }
+            this.updateVisited();
+            return this.isValidRaid() && this.hasSuitablePoi() && this.raider.getTarget() == null;
+        }
 
+        private boolean isValidRaid() {
+            return this.raider.hasActiveRaid() && !this.raider.getCurrentRaid().isOver();
+        }
+
+        private boolean hasSuitablePoi() {
+            ServerLevel worldserver = (ServerLevel) this.raider.level();
+            BlockPos blockposition = this.raider.blockPosition();
+            Optional<BlockPos> optional = worldserver.getPoiManager().getRandom((holder) -> {
+                return holder.is(PoiTypes.HOME);
+            }, this::hasNotVisited, PoiManager.Occupancy.ANY, blockposition, 48, this.raider.random);
+
+            if (optional.isEmpty()) {
                 return false;
             } else {
-                return false;
+                this.poiPos = ((BlockPos) optional.get()).immutable();
+                return true;
             }
         }
 
         @Override
+        public boolean canContinueToUse() {
+            return this.raider.getNavigation().isDone() ? false : this.raider.getTarget() == null && !this.poiPos.closerToCenterThan(this.raider.position(), (double) (this.raider.getBbWidth() + (float) this.distanceToPoi)) && !this.stuck;
+        }
+
+        @Override
+        public void stop() {
+            if (this.poiPos.closerToCenterThan(this.raider.position(), (double) this.distanceToPoi)) {
+                this.visited.add(this.poiPos);
+            }
+
+        }
+
+        @Override
+        public void start() {
+            super.start();
+            this.raider.setNoActionTime(0);
+            this.raider.getNavigation().moveTo((double) this.poiPos.getX(), (double) this.poiPos.getY(), (double) this.poiPos.getZ(), this.speedModifier);
+            this.stuck = false;
+        }
+
+        @Override
         public void tick() {
-            if (this.mob.getNavigation().getTargetPos().closerToCenterThan(this.mob.position(), 1.414)) {
-                List<ItemEntity> list = this.mob
-                    .level()
-                    .getEntitiesOfClass(ItemEntity.class, this.mob.getBoundingBox().inflate(4.0, 4.0, 4.0), Raider.ALLOWED_ITEMS);
-                if (!list.isEmpty()) {
-                    this.mob.pickUpItem(list.get(0));
+            if (this.raider.getNavigation().isDone()) {
+                Vec3 vec3d = Vec3.atBottomCenterOf(this.poiPos);
+                Vec3 vec3d1 = DefaultRandomPos.getPosTowards(this.raider, 16, 7, vec3d, 0.3141592741012573D);
+
+                if (vec3d1 == null) {
+                    vec3d1 = DefaultRandomPos.getPosTowards(this.raider, 8, 7, vec3d, 1.5707963705062866D);
+                }
+
+                if (vec3d1 == null) {
+                    this.stuck = true;
+                    return;
                 }
+
+                this.raider.getNavigation().moveTo(vec3d1.x, vec3d1.y, vec3d1.z, this.speedModifier);
             }
+
+        }
+
+        private boolean hasNotVisited(BlockPos pos) {
+            Iterator iterator = this.visited.iterator();
+
+            BlockPos blockposition1;
+
+            do {
+                if (!iterator.hasNext()) {
+                    return true;
+                }
+
+                blockposition1 = (BlockPos) iterator.next();
+            } while (!Objects.equals(pos, blockposition1));
+
+            return false;
+        }
+
+        private void updateVisited() {
+            if (this.visited.size() > 2) {
+                this.visited.remove(0);
+            }
+
         }
     }
 
     public class RaiderCelebration extends Goal {
+
         private final Raider mob;
 
-        RaiderCelebration(final Raider raider) {
-            this.mob = raider;
+        RaiderCelebration(final Raider entityraider) {
+            this.mob = entityraider;
             this.setFlags(EnumSet.of(Goal.Flag.MOVE));
         }
 
         @Override
         public boolean canUse() {
             Raid raid = this.mob.getCurrentRaid();
+
             return this.mob.isAlive() && this.mob.getTarget() == null && raid != null && raid.isLoss();
         }
 
@@ -422,98 +480,81 @@
         }
     }
 
-    static class RaiderMoveThroughVillageGoal extends Goal {
-        private final Raider raider;
-        private final double speedModifier;
-        private BlockPos poiPos;
-        private final List<BlockPos> visited = Lists.newArrayList();
-        private final int distanceToPoi;
-        private boolean stuck;
+    public class HoldGroundAttackGoal extends Goal {
 
-        public RaiderMoveThroughVillageGoal(Raider raider, double speed, int distance) {
-            this.raider = raider;
-            this.speedModifier = speed;
-            this.distanceToPoi = distance;
-            this.setFlags(EnumSet.of(Goal.Flag.MOVE));
+        private final Raider mob;
+        private final float hostileRadiusSqr;
+        public final TargetingConditions shoutTargeting = TargetingConditions.forNonCombat().range(8.0D).ignoreLineOfSight().ignoreInvisibilityTesting();
+
+        public HoldGroundAttackGoal(final AbstractIllager entityillagerabstract, final float f) { // CraftBukkit - decompile error
+            this.mob = entityillagerabstract;
+            this.hostileRadiusSqr = f * f;
+            this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK));
         }
 
         @Override
         public boolean canUse() {
-            this.updateVisited();
-            return this.isValidRaid() && this.hasSuitablePoi() && this.raider.getTarget() == null;
-        }
+            LivingEntity entityliving = this.mob.getLastHurtByMob();
 
-        private boolean isValidRaid() {
-            return this.raider.hasActiveRaid() && !this.raider.getCurrentRaid().isOver();
+            return this.mob.getCurrentRaid() == null && this.mob.isPatrolling() && this.mob.getTarget() != null && !this.mob.isAggressive() && (entityliving == null || entityliving.getType() != EntityType.PLAYER);
         }
 
-        private boolean hasSuitablePoi() {
-            ServerLevel serverLevel = (ServerLevel)this.raider.level();
-            BlockPos blockPos = this.raider.blockPosition();
-            Optional<BlockPos> optional = serverLevel.getPoiManager()
-                .getRandom(holder -> holder.is(PoiTypes.HOME), this::hasNotVisited, PoiManager.Occupancy.ANY, blockPos, 48, this.raider.random);
-            if (optional.isEmpty()) {
-                return false;
-            } else {
-                this.poiPos = optional.get().immutable();
-                return true;
+        @Override
+        public void start() {
+            super.start();
+            this.mob.getNavigation().stop();
+            List<Raider> list = this.mob.level().getNearbyEntities(Raider.class, this.shoutTargeting, this.mob, this.mob.getBoundingBox().inflate(8.0D, 8.0D, 8.0D));
+            Iterator iterator = list.iterator();
+
+            while (iterator.hasNext()) {
+                Raider entityraider = (Raider) iterator.next();
+
+                entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit
             }
-        }
 
-        @Override
-        public boolean canContinueToUse() {
-            return !this.raider.getNavigation().isDone()
-                && this.raider.getTarget() == null
-                && !this.poiPos.closerToCenterThan(this.raider.position(), (double)(this.raider.getBbWidth() + (float)this.distanceToPoi))
-                && !this.stuck;
         }
 
         @Override
         public void stop() {
-            if (this.poiPos.closerToCenterThan(this.raider.position(), (double)this.distanceToPoi)) {
-                this.visited.add(this.poiPos);
-            }
-        }
+            super.stop();
+            LivingEntity entityliving = this.mob.getTarget();
 
-        @Override
-        public void start() {
-            super.start();
-            this.raider.setNoActionTime(0);
-            this.raider.getNavigation().moveTo((double)this.poiPos.getX(), (double)this.poiPos.getY(), (double)this.poiPos.getZ(), this.speedModifier);
-            this.stuck = false;
-        }
+            if (entityliving != null) {
+                List<Raider> list = this.mob.level().getNearbyEntities(Raider.class, this.shoutTargeting, this.mob, this.mob.getBoundingBox().inflate(8.0D, 8.0D, 8.0D));
+                Iterator iterator = list.iterator();
 
-        @Override
-        public void tick() {
-            if (this.raider.getNavigation().isDone()) {
-                Vec3 vec3 = Vec3.atBottomCenterOf(this.poiPos);
-                Vec3 vec32 = DefaultRandomPos.getPosTowards(this.raider, 16, 7, vec3, (float) (Math.PI / 10));
-                if (vec32 == null) {
-                    vec32 = DefaultRandomPos.getPosTowards(this.raider, 8, 7, vec3, (float) (Math.PI / 2));
-                }
+                while (iterator.hasNext()) {
+                    Raider entityraider = (Raider) iterator.next();
 
-                if (vec32 == null) {
-                    this.stuck = true;
-                    return;
+                    entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit
+                    entityraider.setAggressive(true);
                 }
 
-                this.raider.getNavigation().moveTo(vec32.x, vec32.y, vec32.z, this.speedModifier);
+                this.mob.setAggressive(true);
             }
-        }
 
-        private boolean hasNotVisited(BlockPos pos) {
-            for (BlockPos blockPos : this.visited) {
-                if (Objects.equals(pos, blockPos)) {
-                    return false;
-                }
-            }
+        }
 
+        @Override
+        public boolean requiresUpdateEveryTick() {
             return true;
         }
 
-        private void updateVisited() {
-            if (this.visited.size() > 2) {
-                this.visited.remove(0);
+        @Override
+        public void tick() {
+            LivingEntity entityliving = this.mob.getTarget();
+
+            if (entityliving != null) {
+                if (this.mob.distanceToSqr((Entity) entityliving) > (double) this.hostileRadiusSqr) {
+                    this.mob.getLookControl().setLookAt(entityliving, 30.0F, 30.0F);
+                    if (this.mob.random.nextInt(50) == 0) {
+                        this.mob.playAmbientSound();
+                    }
+                } else {
+                    this.mob.setAggressive(true);
+                }
+
+                super.tick();
             }
         }
     }
