use of net.minecraft.entity.monster.AbstractSkeleton in project NetherEx by LogicTechCorp.
the class EventHandler method onLivingDeath.
@SubscribeEvent
public static void onLivingDeath(LivingDeathEvent event) {
Entity entity = event.getEntity();
World world = entity.getEntityWorld();
BlockPos pos = entity.getPosition();
DamageSource source = event.getSource();
if (entity instanceof AbstractSkeleton) {
if (source.getSourceOfDamage() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) source.getSourceOfDamage();
if (ArmorUtil.isWearingFullArmorSet(player, NetherExMaterials.ARMOR_BONE_WITHERED)) {
player.addStat(NetherExAchievements.FROM_WITHIN);
}
}
}
}
use of net.minecraft.entity.monster.AbstractSkeleton 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);
}
}
}
Aggregations