List of usage examples for net.minecraftforge.event.entity.living EnderTeleportEvent setAttackDamage
public void setAttackDamage(float attackDamage)
From source file:com.github.liachmodded.uhcreloaded.forge.rule.CancelEnderPearlDamage.java
License:Open Source License
@SubscribeEvent(priority = EventPriority.HIGH) public void onPlayerUseEnderPearl(EnderTeleportEvent event) { if (event.getAttackDamage() > 0.0F) { event.setAttackDamage(0.0F); }// w w w .ja va2 s .c om }
From source file:com.lothrazar.cyclicmagic.potion.effect.PotionEnder.java
License:Open Source License
@SubscribeEvent public void onEnderTeleportEvent(EnderTeleportEvent event) { Entity ent = event.getEntity(); if (ent instanceof EntityLivingBase == false) { return;//ww w. ja v a2s .c o m } EntityLivingBase living = (EntityLivingBase) event.getEntity(); if (living.isPotionActive(this)) { event.setAttackDamage(0); } }