Skip to content

Commit

Permalink
Merge pull request #308 from fabbe50/main
Browse files Browse the repository at this point in the history
Fix homing arrow not targeting some hostiles
  • Loading branch information
Direwolf20-MC authored Dec 8, 2024
2 parents 5aca032 + 802a38e commit ef6e1cd
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.animal.axolotl.Axolotl;
import net.minecraft.world.entity.monster.Enemy;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.entity.monster.ZombifiedPiglin;
import net.minecraft.world.entity.player.Player;
Expand Down Expand Up @@ -170,11 +168,11 @@ protected void defineSynchedData(SynchedEntityData.Builder p_326324_) {
}

public static boolean isHostileEntity(LivingEntity entity) {
if (entity instanceof Monster) {
return true;
if (entity instanceof NeutralMob) {
return ((NeutralMob) entity).isAngry();
}
if (entity instanceof ZombifiedPiglin) {
return ((ZombifiedPiglin) entity).isAngry();
if (entity instanceof Enemy) {
return true;
}
return false;
}
Expand Down

0 comments on commit ef6e1cd

Please sign in to comment.