From 9852f61d0fe92a29bf04ce15189a04f688dc4064 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sun, 22 Dec 2019 14:37:19 +0000 Subject: [PATCH] Extend smoke bomb blindness effect to mobs as well as players, closes #324 --- .../wizardry/entity/projectile/EntitySmokeBomb.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/electroblob/wizardry/entity/projectile/EntitySmokeBomb.java b/src/main/java/electroblob/wizardry/entity/projectile/EntitySmokeBomb.java index cbdb5315..8098677a 100644 --- a/src/main/java/electroblob/wizardry/entity/projectile/EntitySmokeBomb.java +++ b/src/main/java/electroblob/wizardry/entity/projectile/EntitySmokeBomb.java @@ -66,12 +66,11 @@ public class EntitySmokeBomb extends EntityBomb { for(EntityLivingBase target : targets){ if(target != this.getThrower()){ - // Gives the target blindness if it is a player, mind trick otherwise (since this has the desired + // Gives the target blindness, and mind trick if it's not a player (since this has the desired // effect of preventing targeting) - if(target instanceof EntityPlayer){ - target.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, duration, 0)); - }else if(target instanceof EntityLiving){ - // New AI + target.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, duration, 0)); + + if(target instanceof EntityLiving){ ((EntityLiving)target).setAttackTarget(null); target.addPotionEffect(new PotionEffect(WizardryPotions.mind_trick, duration, 0)); }