summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
index 25ae8323..5bcc2941 100644
--- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
+++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
@@ -1,5 +1,6 @@
package org.bukkit.event.entity;
+import org.bukkit.entity.Entity;
import org.bukkit.entity.Projectile;
import org.bukkit.event.HandlerList;
@@ -8,9 +9,15 @@ import org.bukkit.event.HandlerList;
*/
public class ProjectileHitEvent extends EntityEvent {
private static final HandlerList handlers = new HandlerList();
+ private final Entity hitEntity;
public ProjectileHitEvent(final Projectile projectile) {
+ this(projectile, null);
+ }
+
+ public ProjectileHitEvent(final Projectile projectile, Entity hitEntity) {
super(projectile);
+ this.hitEntity = hitEntity;
}
@Override
@@ -18,6 +25,15 @@ public class ProjectileHitEvent extends EntityEvent {
return (Projectile) entity;
}
+ /**
+ * Gets the entity that was hit, if it was an entity that was hit.
+ *
+ * @return hit entity or else null
+ */
+ public Entity getHitEntity() {
+ return hitEntity;
+ }
+
@Override
public HandlerList getHandlers() {
return handlers;