List of usage examples for net.minecraftforge.event.entity.living LivingSetAttackTargetEvent getEntityLiving
public LivingEntity getEntityLiving()
From source file:hellfirepvp.astralsorcery.common.event.listener.EventHandlerEntity.java
License:Open Source License
@SubscribeEvent public void onTarget(LivingSetAttackTargetEvent event) { EntityLivingBase living = event.getTarget(); if (living != null && !living.isDead && living instanceof EntityPlayer) { if (invulnerabilityCooldown.contains((EntityPlayer) living)) { event.getEntityLiving().setRevengeTarget(null); if (event.getEntityLiving() instanceof EntityLiving) { ((EntityLiving) event.getEntityLiving()).setAttackTarget(null); }// w w w. j av a 2 s .c om } } }