Example usage for net.minecraftforge.event.entity.living LivingDropsEvent isRecentlyHit

List of usage examples for net.minecraftforge.event.entity.living LivingDropsEvent isRecentlyHit

Introduction

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

Prototype

public boolean isRecentlyHit() 

Source Link

Usage

From source file:mod.rankshank.arbitraria.common.loot.HandlerGrabBagDrops.java

@SubscribeEvent
public void onDeath(LivingDropsEvent event) {
    EntityLivingBase src = (EntityLivingBase) event.getEntity();
    if (!event.getSource().isCreativePlayer() && event.isRecentlyHit()
            && rand.nextInt(12 - event.getLootingLevel()) == 0) {
        double pow = src.getMaxHealth() * (src instanceof IMob ? .2 : .05);
        pow += event.getLootingLevel();/*w  ww  .  jav a 2s.  c  o  m*/
        EnumBagSize size = EnumBagSize.values()[0];
    }
}