001 package org.bukkit.event.entity; 002 003 import org.bukkit.entity.Entity; 004 import org.bukkit.entity.EntityType; 005 import org.bukkit.event.Event; 006 007 /** 008 * Represents an Entity-related event 009 */ 010 public abstract class EntityEvent extends Event { 011 protected Entity entity; 012 013 public EntityEvent(final Entity what) { 014 entity = what; 015 } 016 017 /** 018 * Returns the Entity involved in this event 019 * 020 * @return Entity who is involved in this event 021 */ 022 public Entity getEntity() { 023 return entity; 024 } 025 026 /** 027 * Gets the EntityType of the Entity involved in this event. 028 * 029 * @return EntityType of the Entity involved in this event 030 */ 031 public EntityType getEntityType() { 032 return entity.getType(); 033 } 034 }