mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-01-21 22:31:21 +01:00
Fix boss skills not triggering when being shot with arrows
This commit is contained in:
parent
fe796e255f
commit
47c459ac7c
@ -14,6 +14,9 @@ import com.songoda.epicbosses.utils.RandomUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -44,6 +47,16 @@ public class BossSkillListener implements Listener {
|
||||
Entity entityDamaging = event.getDamager();
|
||||
|
||||
if(!(entityBeingDamaged instanceof LivingEntity)) return;
|
||||
|
||||
if (entityDamaging instanceof Projectile) {
|
||||
Projectile projectile = (Projectile) entityDamaging;
|
||||
LivingEntity shooter = (LivingEntity) projectile.getShooter();
|
||||
|
||||
if (shooter instanceof Player) {
|
||||
entityDamaging = shooter;
|
||||
}
|
||||
}
|
||||
|
||||
if(!(entityDamaging instanceof LivingEntity)) return;
|
||||
|
||||
LivingEntity livingEntity = (LivingEntity) entityBeingDamaged;
|
||||
|
Loading…
Reference in New Issue
Block a user