Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by kinukin, Jun 12, 2017.
How can I check if a player damaged an entity in EntityDamageEvent?
use EntityDamageByEntityEvent and check if damager is player
Sent from my iPhone using Tapatalk
You basically repeated what he said , and the answer is the make an if statement checking if event.getKiller() is instance of Player
Use the EntityDamageByEntityEvent and check if the e.getDamager() is the instance of a Entity. If so, cast Entity to e.getDamager().