Search in sources :

Example 1 with EntityMogus

use of nex.entity.neutral.EntityMogus in project NetherEx by LogicTechCorp.

the class EventHandler method onSetAttackTarget.

@SubscribeEvent
public static void onSetAttackTarget(LivingSetAttackTargetEvent event) {
    EntityLivingBase attacker = (EntityLivingBase) event.getEntity();
    EntityLivingBase attackee = event.getTarget();
    if (attackee instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) attackee;
        if (attacker instanceof AbstractSkeleton) {
            if (ArmorUtil.isWearingFullArmorSet(player, NetherExMaterials.ARMOR_BONE_WITHERED)) {
                ((AbstractSkeleton) attacker).setAttackTarget(null);
                player.addStat(NetherExAchievements.IN_PLAIN_SIGHT);
            }
        }
        if (attacker instanceof EntityPigZombie) {
            player.addStat(NetherExAchievements.UH_OH);
        }
        if (attacker instanceof EntityMogus) {
            player.addStat(NetherExAchievements.CUTE_BUT_DEADLY);
        }
    }
}
Also used : AbstractSkeleton(net.minecraft.entity.monster.AbstractSkeleton) EntityPigZombie(net.minecraft.entity.monster.EntityPigZombie) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityMogus(nex.entity.neutral.EntityMogus) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

EntityLivingBase (net.minecraft.entity.EntityLivingBase)1 AbstractSkeleton (net.minecraft.entity.monster.AbstractSkeleton)1 EntityPigZombie (net.minecraft.entity.monster.EntityPigZombie)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 EntityMogus (nex.entity.neutral.EntityMogus)1