Example usage for net.minecraftforge.event.entity.living EnderTeleportEvent setAttackDamage

List of usage examples for net.minecraftforge.event.entity.living EnderTeleportEvent setAttackDamage

Introduction

In this page you can find the example usage for net.minecraftforge.event.entity.living EnderTeleportEvent setAttackDamage.

Prototype

public void setAttackDamage(float attackDamage) 

Source Link

Usage

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);
    }
}