Example usage for net.minecraftforge.event.entity.living LivingEvent LivingEvent

List of usage examples for net.minecraftforge.event.entity.living LivingEvent LivingEvent

Introduction

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

Prototype

public LivingEvent(LivingEntity entity) 

Source Link

Usage

From source file:org.spongepowered.mod.event.SpongeForgeEventFactory.java

License:MIT License

public static LivingEvent createLivingEvent(Event event) {
    if (!(event instanceof TargetLivingEvent)) {
        throw new IllegalArgumentException("Event is not a valid TargetLivingEvent.");
    }//from w w  w .j  a va 2  s  .  c o  m

    TargetLivingEvent spongeEvent = (TargetLivingEvent) event;
    LivingEvent forgeEvent = new LivingEvent((EntityLivingBase) spongeEvent.getTargetEntity());
    return forgeEvent;
}