From 27ab478e597f4d01a2409a8c96b1f694392c5690 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 25 Feb 2012 14:58:21 +0200 Subject: [PATCH] Added EntityTargetEvent for Experience Orbs, happens when it starts moving towards a human entity! Addresses BUKKIT-820 By: ZNickq --- .../org/bukkit/craftbukkit/event/CraftEventFactory.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 80f4e3db2f..131056522b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -407,4 +407,10 @@ public class CraftEventFactory { creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event); return event; } + + public static EntityTargetEvent callEntityTargetEvent(Entity entity, Entity target, EntityTargetEvent.TargetReason reason) { + EntityTargetEvent event = new EntityTargetEvent(entity.getBukkitEntity(), target.getBukkitEntity(), reason); + entity.getBukkitEntity().getServer().getPluginManager().callEvent(event); + return event; + } }