Skip to content

Commit

Permalink
Fix homing arrow not targeting some hostiles
Browse files Browse the repository at this point in the history
Now targets:
Ender Dragon
Ghast
Magma Cube
Phantom
Shulker
Slime
Hoglin

Also targets angry neutral mobs:
Bee
Iron Golem
Polar Bear
Wolf
Ender Man (not that this one makes sense to fire at, but it's part of the neutral interface).
Zombified Piglin
  • Loading branch information
fabbe50 committed Dec 7, 2024
1 parent 9a881a0 commit 802a38e
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 802a38e

Please sign in to comment.